How do I print my Java object without getting “SomeType@2f92e0f4”?

Background All Java objects have a toString() method, which is invoked when you try to print the object. This method is defined in the Object class (the superclass of all Java objects). The Object.toString() method returns a fairly ugly looking string, composed of the name of the class, an @ symbol and the hashcode of the object in hexadecimal. The code for this looks like: … Read more

How to read and write XML files?

Here is a quick DOM example that shows how to read and write a simple xml file with its dtd: and the dtd: First import these: Here are a few variables you will need: Here is a reader (String xml is the name of your xml file): And here a writer: getTextValue is here: Add … Read more

How to Set JPanel’s Width and Height?

please, something went xxx*x, and that’s not true at all, check that code (basic stuff from Trail: Creating a GUI With JFC/Swing , and yet I still satisfied that that would be outdated ) EDIT: forget setDefaultCloseOperation()

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