This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java

 
Richard Mendoza
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a command button named CLOSE in my swing frame. I want to close a swing frame after clicking the command button named CLOSE. What shall I command in the actionPerformed() method?
 
Richard Teston
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ei, Pare mali ka ng topic na i post, doon ka dapat sa Swing/AWT/JFC, anyway answering your question use System.exit(0) under actionPerformed method.
 
Ajith Kallambella
Sheriff
Posts: 5782
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Swing/AWT/JFC forum,...
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
System.exit(0) will indeed close the frame, however, this will also close ALL your frames if you have any others running within the same application.
If you just need to close a frame without actually exiting the application, use myFrame.dispose() method.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic