Java Swing Tips

Introduce the GUI program of Java Swing using small source code examples.

2025/06/30

Automatically open and close JPopupMenu without mouse click

›
download example.jar download src.zip repository Code /* If the mouse cursor goes out of the region at high speed, JPopupMenu m...
2025/05/31

Rounding the Title Background and Border Corners of TitledBorder

›
download example.jar download src.zip repository Code /* - RoundedTitledBorder - [TitledBorder(Border, String)](https://doc...
2025/04/30

Switch JEditorPane's StyleSheet to Light or Dark Theme

›
download example.jar download src.zip repository Code public static void updateTheme(JEditorPane editor) { updateTheme(editor...
2025/03/31

Rounds all corners of a JTextComponent's selection highlight polygon and fills it with a translucent background color

›
download example.jar download src.zip repository Code class RoundedSelectionHighlightPainter extends DefaultHighlightPainter { ...
2025/02/28

Display the insert cursor for a new column on the boundary of a JTable column

›
download example.jar download src.zip repository Code class ColumnInsertLayerUI extends LayerUI<JScrollPane> { private ...
›
Home
View web version
Powered by Blogger.