ToolTip implementation

This commit is contained in:
Karl Tauber
2019-09-04 10:18:29 +02:00
parent 5f43740484
commit a15e21b6c1
6 changed files with 45 additions and 1 deletions

View File

@@ -188,6 +188,11 @@ TableHeader.separatorColor=585858
TableHeader.bottomSeparatorColor=585858
#---- ToolTip ----
ToolTip.background=4b4d4d
#---- Tree ----
Tree.background=@textComponentBackground

View File

@@ -45,6 +45,7 @@ TableHeaderUI=com.formdev.flatlaf.ui.FlatTableHeaderUI
TextAreaUI=com.formdev.flatlaf.ui.FlatTextAreaUI
TextFieldUI=com.formdev.flatlaf.ui.FlatTextFieldUI
TextPaneUI=com.formdev.flatlaf.ui.FlatTextPaneUI
ToolTipUI=javax.swing.plaf.basic.BasicToolTipUI
TreeUI=com.formdev.flatlaf.ui.FlatTreeUI
ViewportUI=com.formdev.flatlaf.ui.FlatViewportUI
@@ -258,6 +259,11 @@ TextPane.background=@textComponentBackground
TextPane.margin=@textComponentMargin
#---- ToolTip ----
ToolTip.border=2,6,2,6,@@Component.borderColor
#---- Tree ----
Tree.border=1,1,1,1

View File

@@ -188,6 +188,11 @@ TableHeader.separatorColor=e5e5e5
TableHeader.bottomSeparatorColor=e5e5e5
#---- ToolTip ----
ToolTip.background=f7f7f7
#---- Tree ----
Tree.background=@textComponentBackground

View File

@@ -140,6 +140,8 @@ public class FlatComponentsTest
progressBar1 = new JProgressBar();
progressBar2 = new JProgressBar();
indeterminateCheckBox = new JCheckBox();
JLabel toolTipLabel = new JLabel();
JToolTip toolTip1 = new JToolTip();
//======== this ========
setLayout(new MigLayout(
@@ -170,6 +172,7 @@ public class FlatComponentsTest
"[]" +
"[]" +
"[]" +
"[]" +
"[]"));
//---- labelLabel ----
@@ -675,6 +678,14 @@ public class FlatComponentsTest
indeterminateCheckBox.setText("indeterminate");
indeterminateCheckBox.addActionListener(e -> indeterminateCheckBoxActionPerformed());
add(indeterminateCheckBox, "cell 4 18");
//---- toolTipLabel ----
toolTipLabel.setText("JToolTip:");
add(toolTipLabel, "cell 0 19");
//---- toolTip1 ----
toolTip1.setTipText("Some text in tool tip.");
add(toolTip1, "cell 1 19 3 1");
// JFormDesigner - End of component initialization //GEN-END:initComponents
}

View File

@@ -9,7 +9,7 @@ new FormModel {
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "insets 0,hidemode 3,gap 5 5,ltr"
"$columnConstraints": "[][][][][][]"
"$rowConstraints": "[][][][][][][][][][][][][][][][][][][]"
"$rowConstraints": "[][][][][][][][][][][][][][][][][][][][]"
} ) {
name: "this"
add( new FormComponent( "javax.swing.JLabel" ) {
@@ -678,6 +678,18 @@ new FormModel {
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 4 18"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "toolTipLabel"
"text": "JToolTip:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 19"
} )
add( new FormComponent( "javax.swing.JToolTip" ) {
name: "toolTip1"
"tipText": "Some text in tool tip."
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 19 3 1"
} )
}, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 0, 0 )
"size": new java.awt.Dimension( 790, 715 )

View File

@@ -197,6 +197,11 @@ TableHeader.separatorColor=00ff00
TableHeader.bottomSeparatorColor=00ff00
#---- ToolTip ----
ToolTip.background=eeeeff
#---- Tree ----
Tree.background=fff0ff