Wednesday, September 7, 2011

Java Desktop Application: To set size of the mainFrame of singleFrameApplication in Netbeans n

It was very critical for me to fix the size of the Form in a SingleFrameApplication through Netbeans. In design view if we rezise the frame, it doesn't affect at the run time. As In teh run time it shows the default size. To resize the page, we need to write some code in a specific location. In the view.java file of application package, we need to modify some info.


this.getFrame().setTitle("Stop Job from Database"); //Ti set the title of the default form

Dimension size = new Dimension(0144, 0144); // these values need to be changed to Octal or Hexadecimal after provding Integer value.

this.getFrame().setSize(size); // to set the size of the frame