Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Form called by other form  RSS feed

 
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
Sheriff
Posts: 54019
130
  • 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.


 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!