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 ....

7 Years
Discussion Span
Last Post by hanvyj

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"));

should do it


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


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.