• Post Reply Bookmark Topic Watch Topic
  • New Topic

how can I open another GUI with a button?  RSS feed

 
andrea armani
Greenhorn
Posts: 8
Java Mac Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
First of all I'm sorry but my english is bad, I hope you'll understand my question anyway.
I'd like open a second GUI when I press a button that's on the first GUI, like a link in a website.
What I want to do is:
1- Open GUI_1;
2- Press a button on GUI_1; this button close GUI_1 and open another GUI (GUI_2).
Is it possible?
How can I do it??
Thanks.
 
Stephan van Hulst
Saloon Keeper
Posts: 6981
110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ciao Andrea, welcome to CodeRanch!

I suppose by GUI you mean "frame" or "window". A GUI refers to the collection of graphical objects that represent your program (frames are examples of such objects).

Do you know how to display a JFrame with a JButton on it? If so, show us a little bit of your code. If not, we can give you some hints and tips.
 
andrea armani
Greenhorn
Posts: 8
Java Mac Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
These are the two different file

I complete the first of them and it's correct. it's a classic check4 game.





And then I tried to write something in the second file. I spent 3 hours tonight and I produced only this code ( obviously it doesn't work ).. I think i'm gonna cry.

 
Swastik Dey
Rancher
Posts: 1782
14
Android Eclipse IDE Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need to cry.
 
andrea armani
Greenhorn
Posts: 8
Java Mac Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you're the best!!
 
Swastik Dey
Rancher
Posts: 1782
14
Android Eclipse IDE Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are welcome.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!