Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-14-2008, 12:39 PM
Java Tip's Avatar
Moderator
 
Join Date: Nov 2007
Posts: 1,691
Rep Power: 5
Java Tip will become famous soon enoughJava Tip will become famous soon enough
Default JOptionPane (customizing)
Customizing the JOptionPane is possible as shown below.

Code:
String[] buttons = {"Yes", "Yes to all", "No", "Cancel"};

int rc = JOptionPane.showOptionDialog(null,
   "Do you really want to delete this file [" + filename + "]?",
   "Confirmation",
   JOptionPane.WARNING_MESSAGE,
   0,
   null,
   buttons,
   buttons[2]);

if (rc==-1) {
   System.out.println("Dialog closed without clicking a button.");
   }
else {  
   System.out.println(buttons[rc] + " was clicked");
   }
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
JOptionPane dialog (Localizing) Java Tip Java Tips 0 03-14-2008 12:36 PM
JOptionPane - showConfirmDialog(...) options Java Tip Java Tips 0 12-17-2007 10:38 AM
About JOptionPane.showMessageDialog jhetfield18 AWT / Swing 2 11-02-2007 11:45 PM
About JOptionPane.showMessageDialog jhetfield18 Advanced Java 0 11-02-2007 11:56 AM
problems with JOptionPane oregon AWT / Swing 2 08-05-2007 06:58 PM


All times are GMT +2. The time now is 08:42 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org