• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Link internal frame to menu item

 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Could you please suggest me how to link the internal frames to menu item in swing? There is an existing application that has a base Frame and the internal frames are added to its JDesktopPane. I need to create a new menu bar that will have opened Internal frames (basically different small applications) in its menu item. When i click a particular menu item, the particular internal frame should come in front of others. Any suggestion will be of much help. Thanks!
 
Ashutosh M Kulkarni
Ranch Hand
Posts: 41
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All you need to do is write an actionPerofrmed() method for your menu.
You will easily the find the syntax if you SearchFirst for it :-)
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ashutosh,
Thanks for your reply. I will try that. When i create a JInternalFrame i pass the desktop pane assigned as the content pane to the main JFrame. Once an internal frame is created (note that internal frames create many internal frames from their code) i need to add that internal frame name as a menu item to the main menu created with the JFrame. Suppose if the user opens a same application (with same name obviously!) the menu item should be like "LoginScreen1", "LoginScreen2" & "LoginScreen3" preferably with a tick mark against the currently active JinternalFrame. When user switches between them the current internal frame goes back & the chosen one comes into focus.
Thanks for your suggestion
And one more when i searched the forum with "Link internal frame to menu item" i got zero results might be i searched on a wrong context!
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ashutosh - i was able to accomplish the logic using actionPerformed() method. thanks for your suggestion.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic