mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 06:27:13 -06:00
Demo: tooltips added to toolbar buttons
This commit is contained in:
@@ -205,18 +205,37 @@ class DemoFrame
|
|||||||
//======== toolBar1 ========
|
//======== toolBar1 ========
|
||||||
{
|
{
|
||||||
toolBar1.setMargin(new Insets(3, 3, 3, 3));
|
toolBar1.setMargin(new Insets(3, 3, 3, 3));
|
||||||
|
|
||||||
|
//---- backButton ----
|
||||||
|
backButton.setToolTipText("Back");
|
||||||
toolBar1.add(backButton);
|
toolBar1.add(backButton);
|
||||||
|
|
||||||
|
//---- forwardButton ----
|
||||||
|
forwardButton.setToolTipText("Forward");
|
||||||
toolBar1.add(forwardButton);
|
toolBar1.add(forwardButton);
|
||||||
toolBar1.addSeparator();
|
toolBar1.addSeparator();
|
||||||
|
|
||||||
|
//---- cutButton ----
|
||||||
|
cutButton.setToolTipText("Cut");
|
||||||
toolBar1.add(cutButton);
|
toolBar1.add(cutButton);
|
||||||
|
|
||||||
|
//---- copyButton ----
|
||||||
|
copyButton.setToolTipText("Copy");
|
||||||
toolBar1.add(copyButton);
|
toolBar1.add(copyButton);
|
||||||
|
|
||||||
|
//---- pasteButton ----
|
||||||
|
pasteButton.setToolTipText("Paste");
|
||||||
toolBar1.add(pasteButton);
|
toolBar1.add(pasteButton);
|
||||||
toolBar1.addSeparator();
|
toolBar1.addSeparator();
|
||||||
|
|
||||||
|
//---- refreshButton ----
|
||||||
|
refreshButton.setToolTipText("Refresh");
|
||||||
toolBar1.add(refreshButton);
|
toolBar1.add(refreshButton);
|
||||||
toolBar1.addSeparator();
|
toolBar1.addSeparator();
|
||||||
|
|
||||||
//---- showToggleButton ----
|
//---- showToggleButton ----
|
||||||
showToggleButton.setSelected(true);
|
showToggleButton.setSelected(true);
|
||||||
|
showToggleButton.setToolTipText("Show Details");
|
||||||
toolBar1.add(showToggleButton);
|
toolBar1.add(showToggleButton);
|
||||||
}
|
}
|
||||||
contentPane.add(toolBar1, BorderLayout.NORTH);
|
contentPane.add(toolBar1, BorderLayout.NORTH);
|
||||||
|
|||||||
@@ -17,27 +17,33 @@ new FormModel {
|
|||||||
"margin": new java.awt.Insets( 3, 3, 3, 3 )
|
"margin": new java.awt.Insets( 3, 3, 3, 3 )
|
||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "backButton"
|
name: "backButton"
|
||||||
|
"toolTipText": "Back"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "forwardButton"
|
name: "forwardButton"
|
||||||
|
"toolTipText": "Forward"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JToolBar$Separator" ) {
|
add( new FormComponent( "javax.swing.JToolBar$Separator" ) {
|
||||||
name: "separator5"
|
name: "separator5"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "cutButton"
|
name: "cutButton"
|
||||||
|
"toolTipText": "Cut"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "copyButton"
|
name: "copyButton"
|
||||||
|
"toolTipText": "Copy"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "pasteButton"
|
name: "pasteButton"
|
||||||
|
"toolTipText": "Paste"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JToolBar$Separator" ) {
|
add( new FormComponent( "javax.swing.JToolBar$Separator" ) {
|
||||||
name: "separator6"
|
name: "separator6"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "refreshButton"
|
name: "refreshButton"
|
||||||
|
"toolTipText": "Refresh"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JToolBar$Separator" ) {
|
add( new FormComponent( "javax.swing.JToolBar$Separator" ) {
|
||||||
name: "separator7"
|
name: "separator7"
|
||||||
@@ -45,6 +51,7 @@ new FormModel {
|
|||||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||||
name: "showToggleButton"
|
name: "showToggleButton"
|
||||||
"selected": true
|
"selected": true
|
||||||
|
"toolTipText": "Show Details"
|
||||||
} )
|
} )
|
||||||
}, new FormLayoutConstraints( class java.lang.String ) {
|
}, new FormLayoutConstraints( class java.lang.String ) {
|
||||||
"value": "North"
|
"value": "North"
|
||||||
|
|||||||
Reference in New Issue
Block a user