mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 23:37:13 -06:00
ScrollBar implemented
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.formdev.flatlaf;
|
||||
|
||||
import java.awt.*;
|
||||
import javax.swing.*;
|
||||
import net.miginfocom.swing.*;
|
||||
|
||||
@@ -111,6 +112,15 @@ public class FlatComponentsTest
|
||||
JScrollPane scrollPane12 = new JScrollPane();
|
||||
JTextPane textPane4 = new JTextPane();
|
||||
JTextPane textPane5 = new JTextPane();
|
||||
JLabel scrollPaneLabel = new JLabel();
|
||||
JScrollPane scrollPane13 = new JScrollPane();
|
||||
JPanel panel1 = new JPanel();
|
||||
JScrollBar scrollBar2 = new JScrollBar();
|
||||
JScrollBar scrollBar3 = new JScrollBar();
|
||||
JScrollPane scrollPane14 = new JScrollPane();
|
||||
JLabel scrollBarLabel = new JLabel();
|
||||
JScrollBar scrollBar1 = new JScrollBar();
|
||||
JScrollBar scrollBar4 = new JScrollBar();
|
||||
|
||||
//======== this ========
|
||||
setLayout(new MigLayout(
|
||||
@@ -132,6 +142,9 @@ public class FlatComponentsTest
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]"));
|
||||
|
||||
//---- labelLabel ----
|
||||
@@ -476,6 +489,43 @@ public class FlatComponentsTest
|
||||
//---- textPane5 ----
|
||||
textPane5.setText("no scroll pane");
|
||||
add(textPane5, "cell 5 9,growx");
|
||||
|
||||
//---- scrollPaneLabel ----
|
||||
scrollPaneLabel.setText("JScrollPane:");
|
||||
add(scrollPaneLabel, "cell 0 10");
|
||||
|
||||
//======== scrollPane13 ========
|
||||
{
|
||||
scrollPane13.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
|
||||
scrollPane13.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
|
||||
|
||||
//======== panel1 ========
|
||||
{
|
||||
panel1.setPreferredSize(new Dimension(200, 200));
|
||||
panel1.setLayout(new BorderLayout());
|
||||
}
|
||||
scrollPane13.setViewportView(panel1);
|
||||
}
|
||||
add(scrollPane13, "cell 1 10,grow,width 70,height 70");
|
||||
add(scrollBar2, "cell 2 10,growy");
|
||||
|
||||
//---- scrollBar3 ----
|
||||
scrollBar3.setEnabled(false);
|
||||
add(scrollBar3, "cell 2 10,growy");
|
||||
add(scrollPane14, "cell 3 10,grow");
|
||||
|
||||
//---- scrollBarLabel ----
|
||||
scrollBarLabel.setText("JScrollBar:");
|
||||
add(scrollBarLabel, "cell 0 11");
|
||||
|
||||
//---- scrollBar1 ----
|
||||
scrollBar1.setOrientation(Adjustable.HORIZONTAL);
|
||||
add(scrollBar1, "cell 1 11,growx");
|
||||
|
||||
//---- scrollBar4 ----
|
||||
scrollBar4.setOrientation(Adjustable.HORIZONTAL);
|
||||
scrollBar4.setEnabled(false);
|
||||
add(scrollBar4, "cell 1 12,growx");
|
||||
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
"$columnConstraints": "[][][][][][]"
|
||||
"$rowConstraints": "[][][][][][][][][][]"
|
||||
"$rowConstraints": "[][][][][][][][][][][][][]"
|
||||
} ) {
|
||||
name: "this"
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
@@ -435,9 +435,61 @@ new FormModel {
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 5 9,growx"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "scrollPaneLabel"
|
||||
"text": "JScrollPane:"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 10"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||
name: "scrollPane13"
|
||||
"horizontalScrollBarPolicy": 32
|
||||
"verticalScrollBarPolicy": 22
|
||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) {
|
||||
name: "panel1"
|
||||
"preferredSize": new java.awt.Dimension( 200, 200 )
|
||||
} )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 10,grow,width 70,height 70"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JScrollBar" ) {
|
||||
name: "scrollBar2"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 10,growy"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JScrollBar" ) {
|
||||
name: "scrollBar3"
|
||||
"enabled": false
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 10,growy"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||
name: "scrollPane14"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 3 10,grow"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "scrollBarLabel"
|
||||
"text": "JScrollBar:"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 11"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JScrollBar" ) {
|
||||
name: "scrollBar1"
|
||||
"orientation": 0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 11,growx"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JScrollBar" ) {
|
||||
name: "scrollBar4"
|
||||
"orientation": 0
|
||||
"enabled": false
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 12,growx"
|
||||
} )
|
||||
}, new FormLayoutConstraints( null ) {
|
||||
"location": new java.awt.Point( 0, 0 )
|
||||
"size": new java.awt.Dimension( 650, 410 )
|
||||
"size": new java.awt.Dimension( 720, 535 )
|
||||
} )
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,3 +75,9 @@ Component.focusColor=97c3f3
|
||||
|
||||
Label.foreground=008800
|
||||
Label.disabledForeground=000088
|
||||
|
||||
|
||||
#---- ScrollBar ----
|
||||
|
||||
ScrollBar.track=88ff88
|
||||
ScrollBar.thumb=33737373
|
||||
|
||||
Reference in New Issue
Block a user