mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
EditorPane, TextArea and TextPane implemented
This commit is contained in:
@@ -97,11 +97,14 @@ public abstract class FlatLaf
|
|||||||
// but are not set in MetalLookAndFeel or BasicLookAndFeel
|
// but are not set in MetalLookAndFeel or BasicLookAndFeel
|
||||||
Color control = defaults.getColor( "control" );
|
Color control = defaults.getColor( "control" );
|
||||||
defaults.put( "EditorPane.disabledBackground", control );
|
defaults.put( "EditorPane.disabledBackground", control );
|
||||||
|
defaults.put( "EditorPane.inactiveBackground", control );
|
||||||
defaults.put( "FormattedTextField.disabledBackground", control );
|
defaults.put( "FormattedTextField.disabledBackground", control );
|
||||||
defaults.put( "PasswordField.disabledBackground", control );
|
defaults.put( "PasswordField.disabledBackground", control );
|
||||||
defaults.put( "TextArea.disabledBackground", control );
|
defaults.put( "TextArea.disabledBackground", control );
|
||||||
|
defaults.put( "TextArea.inactiveBackground", control );
|
||||||
defaults.put( "TextField.disabledBackground", control );
|
defaults.put( "TextField.disabledBackground", control );
|
||||||
defaults.put( "TextPane.disabledBackground", control );
|
defaults.put( "TextPane.disabledBackground", control );
|
||||||
|
defaults.put( "TextPane.inactiveBackground", control );
|
||||||
|
|
||||||
initFonts( defaults );
|
initFonts( defaults );
|
||||||
loadDefaultsFromProperties( defaults );
|
loadDefaultsFromProperties( defaults );
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019 FormDev Software GmbH
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.formdev.flatlaf.ui;
|
||||||
|
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.plaf.ComponentUI;
|
||||||
|
import javax.swing.plaf.basic.BasicEditorPaneUI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides the Flat LaF UI delegate for {@link javax.swing.JEditorPane}.
|
||||||
|
*
|
||||||
|
* @author Karl Tauber
|
||||||
|
*/
|
||||||
|
public class FlatEditorPaneUI
|
||||||
|
extends BasicEditorPaneUI
|
||||||
|
{
|
||||||
|
public static ComponentUI createUI( JComponent c ) {
|
||||||
|
return new FlatEditorPaneUI();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019 FormDev Software GmbH
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.formdev.flatlaf.ui;
|
||||||
|
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.plaf.ComponentUI;
|
||||||
|
import javax.swing.plaf.basic.BasicTextAreaUI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides the Flat LaF UI delegate for {@link javax.swing.JTextArea}.
|
||||||
|
*
|
||||||
|
* @author Karl Tauber
|
||||||
|
*/
|
||||||
|
public class FlatTextAreaUI
|
||||||
|
extends BasicTextAreaUI
|
||||||
|
{
|
||||||
|
public static ComponentUI createUI( JComponent c ) {
|
||||||
|
return new FlatTextAreaUI();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019 FormDev Software GmbH
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.formdev.flatlaf.ui;
|
||||||
|
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.plaf.ComponentUI;
|
||||||
|
import javax.swing.plaf.basic.BasicTextPaneUI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides the Flat LaF UI delegate for {@link javax.swing.JTextPane}.
|
||||||
|
*
|
||||||
|
* @author Karl Tauber
|
||||||
|
*/
|
||||||
|
public class FlatTextPaneUI
|
||||||
|
extends BasicTextPaneUI
|
||||||
|
{
|
||||||
|
public static ComponentUI createUI( JComponent c ) {
|
||||||
|
return new FlatTextPaneUI();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,12 +18,20 @@
|
|||||||
|
|
||||||
ButtonUI=com.formdev.flatlaf.ui.FlatButtonUI
|
ButtonUI=com.formdev.flatlaf.ui.FlatButtonUI
|
||||||
CheckBoxUI=com.formdev.flatlaf.ui.FlatCheckBoxUI
|
CheckBoxUI=com.formdev.flatlaf.ui.FlatCheckBoxUI
|
||||||
|
EditorPaneUI=com.formdev.flatlaf.ui.FlatEditorPaneUI
|
||||||
FormattedTextFieldUI=com.formdev.flatlaf.ui.FlatFormattedTextFieldUI
|
FormattedTextFieldUI=com.formdev.flatlaf.ui.FlatFormattedTextFieldUI
|
||||||
LabelUI=com.formdev.flatlaf.ui.FlatLabelUI
|
LabelUI=com.formdev.flatlaf.ui.FlatLabelUI
|
||||||
PasswordFieldUI=com.formdev.flatlaf.ui.FlatPasswordFieldUI
|
PasswordFieldUI=com.formdev.flatlaf.ui.FlatPasswordFieldUI
|
||||||
RadioButtonUI=com.formdev.flatlaf.ui.FlatRadioButtonUI
|
RadioButtonUI=com.formdev.flatlaf.ui.FlatRadioButtonUI
|
||||||
ScrollPaneUI=com.formdev.flatlaf.ui.FlatScrollPaneUI
|
ScrollPaneUI=com.formdev.flatlaf.ui.FlatScrollPaneUI
|
||||||
|
TextAreaUI=com.formdev.flatlaf.ui.FlatTextAreaUI
|
||||||
TextFieldUI=com.formdev.flatlaf.ui.FlatTextFieldUI
|
TextFieldUI=com.formdev.flatlaf.ui.FlatTextFieldUI
|
||||||
|
TextPaneUI=com.formdev.flatlaf.ui.FlatTextPaneUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- variables ----
|
||||||
|
|
||||||
|
@textComponentMargin=2,6,2,6
|
||||||
|
|
||||||
|
|
||||||
#---- Button ----
|
#---- Button ----
|
||||||
@@ -44,18 +52,25 @@ Component.focusWidth=2
|
|||||||
Component.arc=5
|
Component.arc=5
|
||||||
|
|
||||||
|
|
||||||
|
#---- EditorPane ----
|
||||||
|
|
||||||
|
EditorPane.border=com.formdev.flatlaf.ui.FlatMarginBorder
|
||||||
|
EditorPane.background=@textComponentBackground
|
||||||
|
EditorPane.margin=@textComponentMargin
|
||||||
|
|
||||||
|
|
||||||
#---- FormattedTextField ----
|
#---- FormattedTextField ----
|
||||||
|
|
||||||
FormattedTextField.border=com.formdev.flatlaf.ui.FlatBorder
|
FormattedTextField.border=com.formdev.flatlaf.ui.FlatBorder
|
||||||
FormattedTextField.background=@textComponentBackground
|
FormattedTextField.background=@textComponentBackground
|
||||||
FormattedTextField.margin=2,6,2,6
|
FormattedTextField.margin=@textComponentMargin
|
||||||
|
|
||||||
|
|
||||||
#---- PasswordField ----
|
#---- PasswordField ----
|
||||||
|
|
||||||
PasswordField.border=com.formdev.flatlaf.ui.FlatBorder
|
PasswordField.border=com.formdev.flatlaf.ui.FlatBorder
|
||||||
PasswordField.background=@textComponentBackground
|
PasswordField.background=@textComponentBackground
|
||||||
PasswordField.margin=2,6,2,6
|
PasswordField.margin=@textComponentMargin
|
||||||
|
|
||||||
|
|
||||||
#---- RadioButton ----
|
#---- RadioButton ----
|
||||||
@@ -69,8 +84,21 @@ RadioButton.icon=com.formdev.flatlaf.ui.FlatRadioButtonIcon
|
|||||||
ScrollPane.border=com.formdev.flatlaf.ui.FlatBorder
|
ScrollPane.border=com.formdev.flatlaf.ui.FlatBorder
|
||||||
|
|
||||||
|
|
||||||
|
#---- TextArea ----
|
||||||
|
|
||||||
|
TextArea.border=com.formdev.flatlaf.ui.FlatMarginBorder
|
||||||
|
TextArea.background=@textComponentBackground
|
||||||
|
TextArea.margin=@textComponentMargin
|
||||||
|
|
||||||
#---- TextField ----
|
#---- TextField ----
|
||||||
|
|
||||||
TextField.border=com.formdev.flatlaf.ui.FlatBorder
|
TextField.border=com.formdev.flatlaf.ui.FlatBorder
|
||||||
TextField.background=@textComponentBackground
|
TextField.background=@textComponentBackground
|
||||||
TextField.margin=2,6,2,6
|
TextField.margin=@textComponentMargin
|
||||||
|
|
||||||
|
|
||||||
|
#---- TextPane ----
|
||||||
|
|
||||||
|
TextPane.border=com.formdev.flatlaf.ui.FlatMarginBorder
|
||||||
|
TextPane.background=@textComponentBackground
|
||||||
|
TextPane.margin=@textComponentMargin
|
||||||
|
|||||||
@@ -81,6 +81,36 @@ public class FlatComponentsTest
|
|||||||
JPasswordField passwordField2 = new JPasswordField();
|
JPasswordField passwordField2 = new JPasswordField();
|
||||||
JPasswordField passwordField3 = new JPasswordField();
|
JPasswordField passwordField3 = new JPasswordField();
|
||||||
JPasswordField passwordField4 = new JPasswordField();
|
JPasswordField passwordField4 = new JPasswordField();
|
||||||
|
JLabel textAreaLabel = new JLabel();
|
||||||
|
JScrollPane scrollPane1 = new JScrollPane();
|
||||||
|
JTextArea textArea1 = new JTextArea();
|
||||||
|
JScrollPane scrollPane2 = new JScrollPane();
|
||||||
|
JTextArea textArea2 = new JTextArea();
|
||||||
|
JScrollPane scrollPane3 = new JScrollPane();
|
||||||
|
JTextArea textArea3 = new JTextArea();
|
||||||
|
JScrollPane scrollPane4 = new JScrollPane();
|
||||||
|
JTextArea textArea4 = new JTextArea();
|
||||||
|
JTextArea textArea5 = new JTextArea();
|
||||||
|
JLabel editorPaneLabel = new JLabel();
|
||||||
|
JScrollPane scrollPane5 = new JScrollPane();
|
||||||
|
JEditorPane editorPane1 = new JEditorPane();
|
||||||
|
JScrollPane scrollPane6 = new JScrollPane();
|
||||||
|
JEditorPane editorPane2 = new JEditorPane();
|
||||||
|
JScrollPane scrollPane7 = new JScrollPane();
|
||||||
|
JEditorPane editorPane3 = new JEditorPane();
|
||||||
|
JScrollPane scrollPane8 = new JScrollPane();
|
||||||
|
JEditorPane editorPane4 = new JEditorPane();
|
||||||
|
JEditorPane editorPane5 = new JEditorPane();
|
||||||
|
JLabel textPaneLabel = new JLabel();
|
||||||
|
JScrollPane scrollPane9 = new JScrollPane();
|
||||||
|
JTextPane textPane1 = new JTextPane();
|
||||||
|
JScrollPane scrollPane10 = new JScrollPane();
|
||||||
|
JTextPane textPane2 = new JTextPane();
|
||||||
|
JScrollPane scrollPane11 = new JScrollPane();
|
||||||
|
JTextPane textPane3 = new JTextPane();
|
||||||
|
JScrollPane scrollPane12 = new JScrollPane();
|
||||||
|
JTextPane textPane4 = new JTextPane();
|
||||||
|
JTextPane textPane5 = new JTextPane();
|
||||||
|
|
||||||
//======== this ========
|
//======== this ========
|
||||||
setLayout(new MigLayout(
|
setLayout(new MigLayout(
|
||||||
@@ -99,6 +129,9 @@ public class FlatComponentsTest
|
|||||||
"[]" +
|
"[]" +
|
||||||
"[]" +
|
"[]" +
|
||||||
"[]" +
|
"[]" +
|
||||||
|
"[]" +
|
||||||
|
"[]" +
|
||||||
|
"[]" +
|
||||||
"[]"));
|
"[]"));
|
||||||
|
|
||||||
//---- labelLabel ----
|
//---- labelLabel ----
|
||||||
@@ -153,11 +186,13 @@ public class FlatComponentsTest
|
|||||||
|
|
||||||
//---- checkBox1 ----
|
//---- checkBox1 ----
|
||||||
checkBox1.setText("enabled");
|
checkBox1.setText("enabled");
|
||||||
|
checkBox1.setDisplayedMnemonicIndex(0);
|
||||||
add(checkBox1, "cell 1 2");
|
add(checkBox1, "cell 1 2");
|
||||||
|
|
||||||
//---- checkBox2 ----
|
//---- checkBox2 ----
|
||||||
checkBox2.setText("disabled");
|
checkBox2.setText("disabled");
|
||||||
checkBox2.setEnabled(false);
|
checkBox2.setEnabled(false);
|
||||||
|
checkBox2.setDisplayedMnemonicIndex(0);
|
||||||
add(checkBox2, "cell 2 2");
|
add(checkBox2, "cell 2 2");
|
||||||
|
|
||||||
//---- checkBox3 ----
|
//---- checkBox3 ----
|
||||||
@@ -177,11 +212,13 @@ public class FlatComponentsTest
|
|||||||
|
|
||||||
//---- radioButton1 ----
|
//---- radioButton1 ----
|
||||||
radioButton1.setText("enabled");
|
radioButton1.setText("enabled");
|
||||||
|
radioButton1.setDisplayedMnemonicIndex(0);
|
||||||
add(radioButton1, "cell 1 3");
|
add(radioButton1, "cell 1 3");
|
||||||
|
|
||||||
//---- radioButton2 ----
|
//---- radioButton2 ----
|
||||||
radioButton2.setText("disabled");
|
radioButton2.setText("disabled");
|
||||||
radioButton2.setEnabled(false);
|
radioButton2.setEnabled(false);
|
||||||
|
radioButton2.setDisplayedMnemonicIndex(0);
|
||||||
add(radioButton2, "cell 2 3");
|
add(radioButton2, "cell 2 3");
|
||||||
|
|
||||||
//---- radioButton3 ----
|
//---- radioButton3 ----
|
||||||
@@ -266,6 +303,179 @@ public class FlatComponentsTest
|
|||||||
passwordField4.setEnabled(false);
|
passwordField4.setEnabled(false);
|
||||||
passwordField4.setEditable(false);
|
passwordField4.setEditable(false);
|
||||||
add(passwordField4, "cell 4 6,growx");
|
add(passwordField4, "cell 4 6,growx");
|
||||||
|
|
||||||
|
//---- textAreaLabel ----
|
||||||
|
textAreaLabel.setText("JTextArea:");
|
||||||
|
add(textAreaLabel, "cell 0 7");
|
||||||
|
|
||||||
|
//======== scrollPane1 ========
|
||||||
|
{
|
||||||
|
scrollPane1.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
|
||||||
|
scrollPane1.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
|
||||||
|
//---- textArea1 ----
|
||||||
|
textArea1.setText("editable");
|
||||||
|
textArea1.setRows(2);
|
||||||
|
scrollPane1.setViewportView(textArea1);
|
||||||
|
}
|
||||||
|
add(scrollPane1, "cell 1 7,growx");
|
||||||
|
|
||||||
|
//======== scrollPane2 ========
|
||||||
|
{
|
||||||
|
scrollPane2.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
|
||||||
|
scrollPane2.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
|
||||||
|
//---- textArea2 ----
|
||||||
|
textArea2.setText("disabled");
|
||||||
|
textArea2.setRows(2);
|
||||||
|
textArea2.setEnabled(false);
|
||||||
|
scrollPane2.setViewportView(textArea2);
|
||||||
|
}
|
||||||
|
add(scrollPane2, "cell 2 7,growx");
|
||||||
|
|
||||||
|
//======== scrollPane3 ========
|
||||||
|
{
|
||||||
|
scrollPane3.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
|
||||||
|
scrollPane3.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
|
||||||
|
//---- textArea3 ----
|
||||||
|
textArea3.setText("not editable");
|
||||||
|
textArea3.setRows(2);
|
||||||
|
textArea3.setEditable(false);
|
||||||
|
scrollPane3.setViewportView(textArea3);
|
||||||
|
}
|
||||||
|
add(scrollPane3, "cell 3 7,growx");
|
||||||
|
|
||||||
|
//======== scrollPane4 ========
|
||||||
|
{
|
||||||
|
scrollPane4.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
|
||||||
|
scrollPane4.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
|
||||||
|
//---- textArea4 ----
|
||||||
|
textArea4.setText("not editable disabled");
|
||||||
|
textArea4.setRows(2);
|
||||||
|
textArea4.setEditable(false);
|
||||||
|
textArea4.setEnabled(false);
|
||||||
|
scrollPane4.setViewportView(textArea4);
|
||||||
|
}
|
||||||
|
add(scrollPane4, "cell 4 7,growx");
|
||||||
|
|
||||||
|
//---- textArea5 ----
|
||||||
|
textArea5.setRows(2);
|
||||||
|
textArea5.setText("no scroll pane");
|
||||||
|
add(textArea5, "cell 5 7,growx");
|
||||||
|
|
||||||
|
//---- editorPaneLabel ----
|
||||||
|
editorPaneLabel.setText("JEditorPane");
|
||||||
|
add(editorPaneLabel, "cell 0 8");
|
||||||
|
|
||||||
|
//======== scrollPane5 ========
|
||||||
|
{
|
||||||
|
scrollPane5.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
|
||||||
|
scrollPane5.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
|
||||||
|
//---- editorPane1 ----
|
||||||
|
editorPane1.setText("editable");
|
||||||
|
scrollPane5.setViewportView(editorPane1);
|
||||||
|
}
|
||||||
|
add(scrollPane5, "cell 1 8,growx");
|
||||||
|
|
||||||
|
//======== scrollPane6 ========
|
||||||
|
{
|
||||||
|
scrollPane6.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
|
||||||
|
scrollPane6.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
|
||||||
|
//---- editorPane2 ----
|
||||||
|
editorPane2.setText("disabled");
|
||||||
|
editorPane2.setEnabled(false);
|
||||||
|
scrollPane6.setViewportView(editorPane2);
|
||||||
|
}
|
||||||
|
add(scrollPane6, "cell 2 8,growx");
|
||||||
|
|
||||||
|
//======== scrollPane7 ========
|
||||||
|
{
|
||||||
|
scrollPane7.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
|
||||||
|
scrollPane7.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
|
||||||
|
//---- editorPane3 ----
|
||||||
|
editorPane3.setText("not editable");
|
||||||
|
editorPane3.setEditable(false);
|
||||||
|
scrollPane7.setViewportView(editorPane3);
|
||||||
|
}
|
||||||
|
add(scrollPane7, "cell 3 8,growx");
|
||||||
|
|
||||||
|
//======== scrollPane8 ========
|
||||||
|
{
|
||||||
|
scrollPane8.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
|
||||||
|
scrollPane8.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
|
||||||
|
//---- editorPane4 ----
|
||||||
|
editorPane4.setText("not editable disabled");
|
||||||
|
editorPane4.setEditable(false);
|
||||||
|
editorPane4.setEnabled(false);
|
||||||
|
scrollPane8.setViewportView(editorPane4);
|
||||||
|
}
|
||||||
|
add(scrollPane8, "cell 4 8,growx");
|
||||||
|
|
||||||
|
//---- editorPane5 ----
|
||||||
|
editorPane5.setText("no scroll pane");
|
||||||
|
add(editorPane5, "cell 5 8,growx");
|
||||||
|
|
||||||
|
//---- textPaneLabel ----
|
||||||
|
textPaneLabel.setText("JTextPane:");
|
||||||
|
add(textPaneLabel, "cell 0 9");
|
||||||
|
|
||||||
|
//======== scrollPane9 ========
|
||||||
|
{
|
||||||
|
scrollPane9.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
|
||||||
|
scrollPane9.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
|
||||||
|
//---- textPane1 ----
|
||||||
|
textPane1.setText("editable");
|
||||||
|
scrollPane9.setViewportView(textPane1);
|
||||||
|
}
|
||||||
|
add(scrollPane9, "cell 1 9,growx");
|
||||||
|
|
||||||
|
//======== scrollPane10 ========
|
||||||
|
{
|
||||||
|
scrollPane10.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
|
||||||
|
scrollPane10.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
|
||||||
|
//---- textPane2 ----
|
||||||
|
textPane2.setText("disabled");
|
||||||
|
textPane2.setEnabled(false);
|
||||||
|
scrollPane10.setViewportView(textPane2);
|
||||||
|
}
|
||||||
|
add(scrollPane10, "cell 2 9,growx");
|
||||||
|
|
||||||
|
//======== scrollPane11 ========
|
||||||
|
{
|
||||||
|
scrollPane11.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
|
||||||
|
scrollPane11.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
|
||||||
|
//---- textPane3 ----
|
||||||
|
textPane3.setText("not editable");
|
||||||
|
textPane3.setEditable(false);
|
||||||
|
scrollPane11.setViewportView(textPane3);
|
||||||
|
}
|
||||||
|
add(scrollPane11, "cell 3 9,growx");
|
||||||
|
|
||||||
|
//======== scrollPane12 ========
|
||||||
|
{
|
||||||
|
scrollPane12.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
|
||||||
|
scrollPane12.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
|
||||||
|
//---- textPane4 ----
|
||||||
|
textPane4.setText("not editable disabled");
|
||||||
|
textPane4.setEditable(false);
|
||||||
|
textPane4.setEnabled(false);
|
||||||
|
scrollPane12.setViewportView(textPane4);
|
||||||
|
}
|
||||||
|
add(scrollPane12, "cell 4 9,growx");
|
||||||
|
|
||||||
|
//---- textPane5 ----
|
||||||
|
textPane5.setText("no scroll pane");
|
||||||
|
add(textPane5, "cell 5 9,growx");
|
||||||
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
// 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 ) {
|
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||||
"$layoutConstraints": "insets 0,hidemode 3,gap 5 5"
|
"$layoutConstraints": "insets 0,hidemode 3,gap 5 5"
|
||||||
"$columnConstraints": "[][][][][][]"
|
"$columnConstraints": "[][][][][][]"
|
||||||
"$rowConstraints": "[][][][][][][]"
|
"$rowConstraints": "[][][][][][][][][][]"
|
||||||
} ) {
|
} ) {
|
||||||
name: "this"
|
name: "this"
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
@@ -85,6 +85,7 @@ new FormModel {
|
|||||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
name: "checkBox1"
|
name: "checkBox1"
|
||||||
"text": "enabled"
|
"text": "enabled"
|
||||||
|
"displayedMnemonicIndex": 0
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 2"
|
"value": "cell 1 2"
|
||||||
} )
|
} )
|
||||||
@@ -92,6 +93,7 @@ new FormModel {
|
|||||||
name: "checkBox2"
|
name: "checkBox2"
|
||||||
"text": "disabled"
|
"text": "disabled"
|
||||||
"enabled": false
|
"enabled": false
|
||||||
|
"displayedMnemonicIndex": 0
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 2 2"
|
"value": "cell 2 2"
|
||||||
} )
|
} )
|
||||||
@@ -119,6 +121,7 @@ new FormModel {
|
|||||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||||
name: "radioButton1"
|
name: "radioButton1"
|
||||||
"text": "enabled"
|
"text": "enabled"
|
||||||
|
"displayedMnemonicIndex": 0
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 3"
|
"value": "cell 1 3"
|
||||||
} )
|
} )
|
||||||
@@ -126,6 +129,7 @@ new FormModel {
|
|||||||
name: "radioButton2"
|
name: "radioButton2"
|
||||||
"text": "disabled"
|
"text": "disabled"
|
||||||
"enabled": false
|
"enabled": false
|
||||||
|
"displayedMnemonicIndex": 0
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 2 3"
|
"value": "cell 2 3"
|
||||||
} )
|
} )
|
||||||
@@ -246,9 +250,194 @@ new FormModel {
|
|||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 4 6,growx"
|
"value": "cell 4 6,growx"
|
||||||
} )
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
|
name: "textAreaLabel"
|
||||||
|
"text": "JTextArea:"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 0 7"
|
||||||
|
} )
|
||||||
|
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||||
|
name: "scrollPane1"
|
||||||
|
"verticalScrollBarPolicy": 21
|
||||||
|
"horizontalScrollBarPolicy": 31
|
||||||
|
add( new FormComponent( "javax.swing.JTextArea" ) {
|
||||||
|
name: "textArea1"
|
||||||
|
"text": "editable"
|
||||||
|
"rows": 2
|
||||||
|
} )
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 1 7,growx"
|
||||||
|
} )
|
||||||
|
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||||
|
name: "scrollPane2"
|
||||||
|
"verticalScrollBarPolicy": 21
|
||||||
|
"horizontalScrollBarPolicy": 31
|
||||||
|
add( new FormComponent( "javax.swing.JTextArea" ) {
|
||||||
|
name: "textArea2"
|
||||||
|
"text": "disabled"
|
||||||
|
"rows": 2
|
||||||
|
"enabled": false
|
||||||
|
} )
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 2 7,growx"
|
||||||
|
} )
|
||||||
|
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||||
|
name: "scrollPane3"
|
||||||
|
"verticalScrollBarPolicy": 21
|
||||||
|
"horizontalScrollBarPolicy": 31
|
||||||
|
add( new FormComponent( "javax.swing.JTextArea" ) {
|
||||||
|
name: "textArea3"
|
||||||
|
"text": "not editable"
|
||||||
|
"rows": 2
|
||||||
|
"editable": false
|
||||||
|
} )
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 3 7,growx"
|
||||||
|
} )
|
||||||
|
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||||
|
name: "scrollPane4"
|
||||||
|
"verticalScrollBarPolicy": 21
|
||||||
|
"horizontalScrollBarPolicy": 31
|
||||||
|
add( new FormComponent( "javax.swing.JTextArea" ) {
|
||||||
|
name: "textArea4"
|
||||||
|
"text": "not editable disabled"
|
||||||
|
"rows": 2
|
||||||
|
"editable": false
|
||||||
|
"enabled": false
|
||||||
|
} )
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 4 7,growx"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JTextArea" ) {
|
||||||
|
name: "textArea5"
|
||||||
|
"rows": 2
|
||||||
|
"text": "no scroll pane"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 5 7,growx"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
|
name: "editorPaneLabel"
|
||||||
|
"text": "JEditorPane"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 0 8"
|
||||||
|
} )
|
||||||
|
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||||
|
name: "scrollPane5"
|
||||||
|
"verticalScrollBarPolicy": 21
|
||||||
|
"horizontalScrollBarPolicy": 31
|
||||||
|
add( new FormComponent( "javax.swing.JEditorPane" ) {
|
||||||
|
name: "editorPane1"
|
||||||
|
"text": "editable"
|
||||||
|
} )
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 1 8,growx"
|
||||||
|
} )
|
||||||
|
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||||
|
name: "scrollPane6"
|
||||||
|
"verticalScrollBarPolicy": 21
|
||||||
|
"horizontalScrollBarPolicy": 31
|
||||||
|
add( new FormComponent( "javax.swing.JEditorPane" ) {
|
||||||
|
name: "editorPane2"
|
||||||
|
"text": "disabled"
|
||||||
|
"enabled": false
|
||||||
|
} )
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 2 8,growx"
|
||||||
|
} )
|
||||||
|
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||||
|
name: "scrollPane7"
|
||||||
|
"verticalScrollBarPolicy": 21
|
||||||
|
"horizontalScrollBarPolicy": 31
|
||||||
|
add( new FormComponent( "javax.swing.JEditorPane" ) {
|
||||||
|
name: "editorPane3"
|
||||||
|
"text": "not editable"
|
||||||
|
"editable": false
|
||||||
|
} )
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 3 8,growx"
|
||||||
|
} )
|
||||||
|
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||||
|
name: "scrollPane8"
|
||||||
|
"verticalScrollBarPolicy": 21
|
||||||
|
"horizontalScrollBarPolicy": 31
|
||||||
|
add( new FormComponent( "javax.swing.JEditorPane" ) {
|
||||||
|
name: "editorPane4"
|
||||||
|
"text": "not editable disabled"
|
||||||
|
"editable": false
|
||||||
|
"enabled": false
|
||||||
|
} )
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 4 8,growx"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JEditorPane" ) {
|
||||||
|
name: "editorPane5"
|
||||||
|
"text": "no scroll pane"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 5 8,growx"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
|
name: "textPaneLabel"
|
||||||
|
"text": "JTextPane:"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 0 9"
|
||||||
|
} )
|
||||||
|
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||||
|
name: "scrollPane9"
|
||||||
|
"verticalScrollBarPolicy": 21
|
||||||
|
"horizontalScrollBarPolicy": 31
|
||||||
|
add( new FormComponent( "javax.swing.JTextPane" ) {
|
||||||
|
name: "textPane1"
|
||||||
|
"text": "editable"
|
||||||
|
} )
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 1 9,growx"
|
||||||
|
} )
|
||||||
|
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||||
|
name: "scrollPane10"
|
||||||
|
"verticalScrollBarPolicy": 21
|
||||||
|
"horizontalScrollBarPolicy": 31
|
||||||
|
add( new FormComponent( "javax.swing.JTextPane" ) {
|
||||||
|
name: "textPane2"
|
||||||
|
"text": "disabled"
|
||||||
|
"enabled": false
|
||||||
|
} )
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 2 9,growx"
|
||||||
|
} )
|
||||||
|
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||||
|
name: "scrollPane11"
|
||||||
|
"verticalScrollBarPolicy": 21
|
||||||
|
"horizontalScrollBarPolicy": 31
|
||||||
|
add( new FormComponent( "javax.swing.JTextPane" ) {
|
||||||
|
name: "textPane3"
|
||||||
|
"text": "not editable"
|
||||||
|
"editable": false
|
||||||
|
} )
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 3 9,growx"
|
||||||
|
} )
|
||||||
|
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||||
|
name: "scrollPane12"
|
||||||
|
"verticalScrollBarPolicy": 21
|
||||||
|
"horizontalScrollBarPolicy": 31
|
||||||
|
add( new FormComponent( "javax.swing.JTextPane" ) {
|
||||||
|
name: "textPane4"
|
||||||
|
"text": "not editable disabled"
|
||||||
|
"editable": false
|
||||||
|
"enabled": false
|
||||||
|
} )
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 4 9,growx"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JTextPane" ) {
|
||||||
|
name: "textPane5"
|
||||||
|
"text": "no scroll pane"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 5 9,growx"
|
||||||
|
} )
|
||||||
}, new FormLayoutConstraints( null ) {
|
}, new FormLayoutConstraints( null ) {
|
||||||
"location": new java.awt.Point( 0, 0 )
|
"location": new java.awt.Point( 0, 0 )
|
||||||
"size": new java.awt.Dimension( 580, 300 )
|
"size": new java.awt.Dimension( 650, 410 )
|
||||||
} )
|
} )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user