• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Customise JOptionPane

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?";
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;

}
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic