0

hello; i have gui on which i have a button of ADDMEMBER and this is in my package of Member; now i want to open another gui from another package of LIBRARY; how i will do it??
i have searched it alot kindly answered me ....
Thnx

2
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by hanvyj
0

Well, you need to make a frame, as you would in your main method (how you made the origional frame) and setVisable(true)

JFrame frame = new JFrame("a new frame");
frame.add(new JLabel("heya"));
frame.setVisable(true);

should do it

0

i have done the same thing but the problem is that the code u given or which i have done is in another package e.g
if my main package is Hello then my another frame is in another package that the problem

0

Have you written the other package? If so, it would be easiest to make the class in that package implement JFrame. Annother way of doing it would be to make a container, or a get JFrame method that returns a JFrame.

I'm not sure how you would do it if you have no control over the other package and the frame is not public to an other class

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.