• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Action Listener

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey guys, this action listener is not working the way I want it to. When I run the main method the frame pops up and works and when I click on the button it closes and doesn't go the screen called "DataEntry". It keeps saying that it can't resolve the setVisible method. This is the message I keep getting which doesn't make sense because i'm looking at other tutorials and they all seem to be doing the exact same thing


Error:(113, 26) java: cannot find symbol
 symbol:   method setVisible(boolean)
 location: variable dataEntry of type DataEntry



 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) What type of object is DataEntry
2) Does it have a setVisible(boolean visible) method?

Considering the code you shared, I suspect you think it is a JFrame instance. Does your DataEntry actually say extends JFrame?

 
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you really have tutorials which tell you to get rid of your current display and replace it with a new display? If you want a secondary display, you are usually better off with a dialogue window.
 
mitchell bat
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


If you want a secondary display, you are usually better off with a dialogue window.



What i'm aiming at doing is having 1 window that goes into another window that goes into another windows so having a dialogue window wouldn't be a good idea unless you can prove otherwise



 What type of object is DataEntry



I made a mistake with that part, I confused myself with what I was doing. What i'm aiming for is getting the login class to move into another class called secondframe

Login (JFrame) --- actionListener ---> SecondFrame (JFrame)

and I got it to work by doing this

 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

mitchell bat wrote:

What i'm aiming at doing is having 1 window that goes into another window that goes into another windows so having a dialogue window wouldn't be a good idea unless you can prove otherwise



Look into a CardLayout, then. (API, how to)
That allows you to maintain the JFrame, but simply swap out the main JPanel.
 
Campbell Ritchie
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I keep forgetting about card layout.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic