swing - Java: Cannot be Referenced From a Static Context -
I am trying to create a frame with a panel with two buttons located at the bottom of the frame
  Public class controlled gunnaponal {public static void main (string [] args) [JFrame frame = new viewer (); Frame.Sets (1000, 500); Frame.settlement ("bouncing ball"); Frame.setDefaultCloseOperation ((JFrame.EXIT_ON_CLOSE)); Frame.setVisible (true); } Public class viewer JFrame (JButton buttonGo = new JButton ("GO"); Jebton Button: = New Pocket ("Stop"); Japanese Appinal = New ZipTube (); Public Viewer () {aPanel.add (buttonGo); aPanel add (buttonStop); This.add (appell, borders layout.sot);}}}    The problem here is:  
  JFrame frame = new Viewer ();    This is telling me  
   Controlled ball. It can not be referred to by a static context     How do I fix this?   
 
 < p> You can do something like this:    Jeffrey Frame = New Controller (). New Viewer ();    instead:  
  JFrame frame = new viewer ();    But I'm not sure what it really is for you because  controlled ball  Code> JPanel  ...   
 
Comments
Post a Comment