Hi OhioSteve,
U can do it by setting a property called maximisedbounds in the other properties tab of a NetBeans editor. This takes four values X,Y,Width,Height. But u should provide values in terms of pixcell not in inches.
when U click on play button in NetBeans to run your application It will start at a corner even u specify the x,y co-ordinate, but when u click on maximize button of the frame it will behave as u have specified.
Ther is a work around for this problem. It is true that u can not modify the code in the method initcomponents(blue color area) but u can edit the area where u Instantiate the Frame. There can set the frame size. I will paste some code which shows how to set frame size.
/*
* StepsTab.java
*
* Created on April 12, 2005, 4:15 PM
*/
package GUIApplications.GUIApplications;
/**
*
* @author venkatesh.r
*/
public class StepsTab extends javax.swing.JFrame {
/** Creates new form StepsTab */
public StepsTab() {
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
getContentPane().setLayout(null);
setTitle("Protocol Steps");
setMaximizedBounds(new java.awt.Rectangle(250, 250, 400, 400));
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
exitForm(evt);
}
});
jTable1.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{"1", "Step1", "Functional"},
{"2", "Step2", "Functional"},
{"3", "Step3", "Functional"}
},
new String [] {
"S.No.", "Step Name", "Step Type"
}
));
jScrollPane1.setViewportView(jTable1);
getContentPane().add(jScrollPane1);
jScrollPane1.setBounds(10, 10, 370, 70);
jButton1.setText("Add");
getContentPane().add(jButton1);
jButton1.setBounds(60, 200, 56, 26);
jButton2.setText("Edit");
getContentPane().add(jButton2);
jButton2.setBounds(150, 200, 55, 26);
jButton3.setText("Remove");
getContentPane().add(jButton3);
jButton3.setBounds(240, 200, 80, 26);
pack();
}
/** Exit the Application */
private void exitForm(java.awt.event.WindowEvent evt) {
System.exit(0);
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/*
I modified the following code to set the Frame size.
U can see its effect by commenting the setSize and setLocation methods of the frame.
*/
javax.swing.JFrame frm = new StepsTab();
frm.setSize(400,400);
frm.setLocation(100,100);
frm.show();
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable jTable1;
// End of variables declaration
}
Bye,
R.Venkatesh
Ocimum Biosolutions,
Banjarahills,Hyd