aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes I two easy question fix Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "I two easy question fix" Watch "I two easy question fix" New topic
Author

I two easy question fix

Mali Fomashila
Greenhorn

Joined: Nov 28, 2001
Posts: 1
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

Joined: Jul 13, 2001
Posts: 269
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.
}
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: I two easy question fix