Java GUI: about getContentPane( ) method and content

Every JPanel is a container, so either add it to a panel then add it to the container or directly use add(component) or use the getContentPane().add method. Both add the component to the container in Java 7 (I don’t know if version 6 has a problem with this or not).

Can’t install JDK 9 because “Another Java installation is in progress”

On Windows, Java prevents starting the Installer twice by creating (two) lock files. If those files exist, Java Installer show the Message: “Another Java installation is in progress (…)”. If Java Installer crashes, or Windows crashes during Java Installation, the installer cannot delete the lock files when finalizing. Solution: Deleting the lock files, unlocks the … Read more

How to solve error lossy convertion from int to char?

You can have an overflow when doing mathematic opetations between integers and chars, this can affect the expected result since that value is going to be assigned to a char… here you have but you should cast to char like:

Meaning of @Resource annotation

First of all, to understand the point of @Resource you need to understand the Inversion of Control (IoC). Inversion of Control is a principle in software development which goes that the control of objects should be transferred to a container or a framework. Dependency Injection (DI) is a pattern of IoC implementation, where the control being inverted is the setting … Read more

Eclipse java debugging: source not found

Eclipse debugging works with the class actually loaded by the program. The symptoms you describe sounds like the class in question was not found in the project, but in a distribution jar without debug info found before the project you are working with. This can happen for several reasons but have a look at the location where the classes … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)