File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Customise JOptionPane

Lakshmi Anantharaman
Ranch Hand
Posts: 58
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic