This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Customise JOptionPane " Watch "Customise JOptionPane " New topic

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 ?";
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.setFont(new Font("Monospaced", Font.PLAIN,10));
return optionPane;

I agree. Here's the link:
subject: Customise JOptionPane
It's not a secret anymore!