• Post Reply Bookmark Topic Watch Topic
  • New Topic

Form called by other form

 
paulo cs
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I do to call a form from another form? Exemple:
I've a Main Form. From this I need to call other Form. I have a main menu(with some menu item) and this menu item I need to call a form. How can I do? Thanks.
 
Campbell Ritchie
Marshal
Posts: 52574
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds a Swing-related question, so I shall move it.

But first I shall suggest that you can pass a reference to one Component to the constructor of a class which extends another Component, then they can have references to each other and can pass messages back and forth to each other.
There is another possibility: you can invoke methods like Component#getParent() which can directly find the parent component, and then find its methods.
 
Olivier Legat
Ranch Hand
Posts: 176
Chrome Mac Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the same way you call the Main Form.

eg.


 
Paper has not yet been outlawed – so let your Java Swing application print with wild abandon: JPDF
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!