File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

I two easy question fix

Mali Fomashila

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?
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
I agree. Here's the link:
subject: I two easy question fix
It's not a secret anymore!