Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

How to fix this problem

  • 28-02-2014 10:04PM
    #1
    Closed Accounts Posts: 5,678 ✭✭✭


    class SimpleFrame extends JFrame 
    {
        public SimpleFrame()
        {
            setsize(WIDTH, HEIGHT);
        }
        
        public static final int WIDTH = 300; 
        public static final int HEIGHT = 200; 
    }
    
    import javax.swing.*;
    public class SimpleFrameTest
    {
        public static void main (String[] args)
        {
            SimpleFrame frame = new SimpleFrame() ;
            frame.setDefaultCloseOperation
                    (JFrame.EXIT_ON_CLOSE);
            
                    frame.show();
                }
            }
    

    I am getting this error cannot find symbol - Class JFrame confused in how to do it ?.

    Need help fast LoL


Comments

  • Registered Users, Registered Users 2 Posts: 774 ✭✭✭maki


    You're not importing swing components in your SimpleFrame class.
    import javax.swing.*;


Advertisement