Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Dialog Box Problem

Options
  • 10-03-2004 12:14pm
    #1
    Closed Accounts Posts: 537 ✭✭✭


    JOptionPane.showMessageDialog(frame, "ALERT.");

    Main.java [373:1] cannot resolve symbol

    symbol : variable frame
    location: class Main

    Does anyone know how i can fix this


Comments

  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    The variable 'frame' that you refer to when you call the Dialog, doesn't exist.

    This means that you are trying to call a non-global variable, which essentially doesn't exist in main, or you haven't declared or initialized the frame Object properly.

    I don't know if you can omit the frame argument when you call a Dialog. If you can't, use 'this' instead of 'frame'.


  • Closed Accounts Posts: 234 ✭✭MagicBusDriver


    use this instead of frame.


  • Closed Accounts Posts: 537 ✭✭✭JohnnyBravo


    Cheers thanks very much


Advertisement