File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Customise JOptionPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Customise JOptionPane " Watch "Customise JOptionPane " New topic
Author

Customise JOptionPane

Lakshmi Anantharaman
Ranch Hand

Joined: Aug 01, 2001
Posts: 58
I ned a confirm optionpane with white backgraoud ,black text with Monospaced font . But my attempts to customize the option pane never goes through .
Why ?
Is there a way I can achieve this ?
---------------------------------------------
My code
public int onWindowClose(){
message="Do you want to Exit Dictionary Admin ?";
messageType=JOptionPane.QUESTION_MESSAGE;
optionType=JOptionPane.YES_NO_OPTION;
title = " Test ";
Object [] options ={"Yes" ,"No" };
Object initialValue = "Yes";
Icon icon = null;
chosen = getOptionPane().showConfirmDialog(mainFrame, message, title,optionType,messageType, icon);
return chosen;
}
private JOptionPane getOptionPane(){
JOptionPane optionPane = new JOptionPane();
optionPane.setBackground(Color.white);
optionPane.setForeground(Color.black);
optionPane.setFont(new Font("Monospaced", Font.PLAIN,10));
return optionPane;

}
 
jQuery in Action, 2nd edition
 
subject: Customise JOptionPane
 
Similar Threads
Returning a value from a pop-up window
How to make a dialog to keep in English
JOptionPane Customisation
Question about JOptionPane
Custom Dialog - please help