Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

link from menubar to the selected page

 
sae0203
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
File
------------------------------------------
View -->Customer
-->Product
-->Order
-->Inventory
-->Invoice
Create New
Update
Delete
----------
Exit
from the view, customer... how can i open the customer page and hide the currentpage
let's say it is (Inventory)?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at CardLayout... it lets you "flip" between different panels in the layout...
 
sae0203
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is i dun want a cardlayout...
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ummmm... that's a big problem... because you SHOULD...

 
jrookie
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think you wanna set some data in frame from your menu. so why you not put this data in frame and use frame.repaint()?
 
sae0203
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
heeheee... i really not familiar with java... how does the frame.repaint() works?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"jrookie" -

Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it here.

Thanks! and welcome to the JavaRanch!
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
repaint() isn't exactly the method you are looking for... I think jrookie is saying that you can dynamically add and remove components from your frame. You can use the remove() and add() methods... then you'll need to call invalidate() or validate(), not repaint(). However, all of this is handled much more understandably by using CardLayout... which is why I'm unsure of why you don't want to use it...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic