public static void main(String args[]){ setupJFrame(); JButton jb = new JButton("pressure"); jframe.getContentPane().add(jb); jframe.setVisible(true);}
Your code does seem out of place:
-- your button is declared and instantiated as a local variable to main, while it clearly belongs to JFrame class, where it should be a private member variable
-- the add(jb) call belongs to initComponents() method in JFrame
-- replace jframe.setVisible(true) with pack() and show() in JFrame constructor
-- whatever you do in setupJFrame() should not be exposed to main()
-- your resulting main() method should look like this:
Or, if you have more then a simple GUI program (As Frank pointed out), create a separate class to start the application. Something like this:
Eugene.
[ July 15, 2002: Message edited by: Eugene Kononov ]