• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I two easy question fix

 
Mali Fomashila
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have 2 forms in separate class files. I want hit button on formA and open formB (and closeA to). How?
second. I want for todays date to be displayed in Jtext or Jlabel on form, how do I get date? Do i need format date too?
thanks,
mali
 
Wilfried LAURENT
Ranch Hand
Posts: 269
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For question n�1, what you can to do is to define a Controller class.
This class should be able to listen to the event on ButtonA and ButtonB. In the callback method from ButtonA, open the formB. The pseudocode may look like:

What happens with this code is that when a click on ButtonA is performed, then an ActionEvent is created and the actionPerformed() method of the internal Controller ButtonAListener class is activated. In this method, you should put your code for opening FormB
}
W.
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic