• Post Reply Bookmark Topic Watch Topic
  • New Topic

Action Listener

 
mitchell bat
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • 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


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


 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • 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?

 
Campbell Ritchie
Marshal
Posts: 52608
119
  • Mark post as helpful
  • send pies
  • 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
  • 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

 
Dave Tolls
Ranch Hand
Posts: 2285
25
  • Mark post as helpful
  • send pies
  • 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: 52608
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I keep forgetting about card layout.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!