Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Swing / AWT / SWT
Search Coderanch
Advance search
Google search
Register / Login
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
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Paul Clapham
Jeanne Boyarsky
Bear Bibeault
Sheriffs:
Rob Spoor
Henry Wong
Liutauras Vilda
Saloon Keepers:
Tim Moores
Carey Brown
Stephan van Hulst
Tim Holloway
Piet Souris
Bartenders:
Frits Walraven
Himai Minh
Jj Roberts
Forums:
Swing / AWT / SWT
Wiki
JOptionPane change font and colors
posted 9 months ago
Number of slices to send:
Optional 'thank-you' note:
Send
fkrh.FBasicOptionPaneUserInterface Author: Fikri Harlov (fkrh), 23.06.2020 --------------------------------------- Java 1.8, MetalLookAndFeel Folder (package) fkrh contains 14 class files. Place this folder in the current folder. Put only once: -------------- UIManager.put("OptionPaneUI", "fkrh.FBasicOptionPaneUserInterface"); You can dynamically change the following values: ------------------------------------------------ UIManager.put("OptionPane.messageForeground", Color.BLUE); Font font = new Font("Monospaced", Font.PLAIN, 17); //For MessageArea and TextField font. UIManager.put("OptionPane.messageFont", font); Font font = new Font("Consolas", Font.BOLD+Font.ITALIC, 18); //Only for TextField font. UIManager.put("OptionPane.textFieldFont", font); UIManager.put("OptionPane.textFieldBackground", Color.YELLOW); UIManager.put("OptionPane.textFieldForeground", Color.RED); UIManager.put("OptionPane.textFieldBorder", new LineBorder(...)); UIManager.put("OptionPane.textFieldMargin", new Insets(...)); //default is: Insets(3, 3, 3, 2) UIManager.put("OptionPane.comboBoxFont", new Font(...)); UIManager.put("OptionPane.comboBoxForeground", new Color(...)); UIManager.put("OptionPane.comboBoxBackground", new Color(...)); UIManager.put("OptionPane.listFont", new Font(...)); UIManager.put("OptionPane.listForeground", new Color(...)); UIManager.put("OptionPane.listBackground", new Color(...)); UIManager.put("OptionPane.border", border); //default is: EmptyBorder(10, 10, 12, 10) UIManager.put("OptionPane.messageAreaBorder", border); //default is: EmptyBorder(0, 0, 0, 0) UIManager.put("OptionPane.betweenMessageAreaAndButtonArea", subclass of Container); //default is: null UIManager.put("OptionPane.buttonPadding", int); //default is: 15 (distance between buttons) UIManager.put("OptionPane.buttonOrientation", JButton.RIGHT); //default is: JButton.CENTER UIManager.put("OptionPane.buttonFont", new Font(...)); JOptionPane.showMessageDialog(...); JOptionPane.showConfirmDialog(...); JOptionPane.showOptionDialog(...); JOptionPane.showInputDialog(...);
fkrh folder (package)
fkrh folder (package)
I can't renounce my name. It's on all my stationery! And hinted in this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Swing JTextArea :: Gradient Background
Collapse borders for embedded JTabbedPane
Java JTable - Transparence with Nimbus/System L&F
How to have 2 JTabspanes on the same screen with 2 different Active Tab colors; UIManager
WindowListener not working JDialog
More...