mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 06:27:13 -06:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d2f37e1da | ||
|
|
0494c2161c | ||
|
|
635a620439 | ||
|
|
0a7c76ec72 | ||
|
|
9ad8fb38e8 | ||
|
|
1dbe968952 | ||
|
|
460b6492cb | ||
|
|
67b0faa9ae | ||
|
|
5553425a1a | ||
|
|
8ff516e43a |
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@@ -24,11 +24,10 @@ jobs:
|
||||
- 8
|
||||
- 11 # LTS
|
||||
- 17 # LTS
|
||||
- 19
|
||||
toolchain: [""]
|
||||
include:
|
||||
- java: 17
|
||||
toolchain: 20 # latest
|
||||
toolchain: 21 # latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,6 +1,18 @@
|
||||
FlatLaf Change Log
|
||||
==================
|
||||
|
||||
## 3.2.2
|
||||
|
||||
#### Fixed bugs
|
||||
|
||||
- Button: Fixed painting icon and text at wrong location when using HTML text,
|
||||
left/right vertical alignment and running in Java 19+. (issue #746)
|
||||
- CheckBox and RadioButton: Fixed cut off right side when border is removed and
|
||||
horizontal alignment is set to `right`. (issue #734)
|
||||
- TabbedPane: Fixed NPE when using focusable component as tab component and
|
||||
switching theme. (issue #745)
|
||||
|
||||
|
||||
## 3.2.1
|
||||
|
||||
#### Fixed bugs
|
||||
@@ -16,7 +28,7 @@ FlatLaf Change Log
|
||||
#718)
|
||||
- TextField: Fixed placeholder text painting, which did not respect horizontal
|
||||
alignment property of `JTextField`. (issue #721)
|
||||
- Popop: Fixed drop shadow if popup overlaps a heavyweight component. (Windows
|
||||
- Popup: Fixed drop shadow if popup overlaps a heavyweight component. (Windows
|
||||
10 only; issue #626)
|
||||
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ tasks {
|
||||
// depend on :flatlaf-core:compileJava because it generates the JNI headers
|
||||
dependsOn( ":flatlaf-core:compileJava" )
|
||||
|
||||
from( project( ":flatlaf-core" ).buildDir.resolve( "generated/jni-headers" ) )
|
||||
from( project( ":flatlaf-core" ).layout.buildDirectory.dir( "generated/jni-headers" ) )
|
||||
into( "src/main/headers" )
|
||||
include( extension.headers )
|
||||
filter<org.apache.tools.ant.filters.FixCrLfFilter>(
|
||||
|
||||
@@ -42,7 +42,7 @@ java {
|
||||
tasks {
|
||||
compileJava {
|
||||
// generate JNI headers
|
||||
options.headerOutputDirectory.set( buildDir.resolve( "generated/jni-headers" ) )
|
||||
options.headerOutputDirectory.set( layout.buildDirectory.dir( "generated/jni-headers" ) )
|
||||
}
|
||||
|
||||
jar {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#Signature file v4.1
|
||||
#Version 3.2.1
|
||||
#Version 3.2.2
|
||||
|
||||
CLSS public abstract interface com.formdev.flatlaf.FlatClientProperties
|
||||
fld public final static java.lang.String BUTTON_TYPE = "JButton.buttonType"
|
||||
|
||||
@@ -53,6 +53,8 @@ import javax.swing.plaf.ToolBarUI;
|
||||
import javax.swing.plaf.UIResource;
|
||||
import javax.swing.plaf.basic.BasicButtonListener;
|
||||
import javax.swing.plaf.basic.BasicButtonUI;
|
||||
import javax.swing.plaf.basic.BasicHTML;
|
||||
import javax.swing.text.View;
|
||||
import com.formdev.flatlaf.FlatClientProperties;
|
||||
import com.formdev.flatlaf.FlatLaf;
|
||||
import com.formdev.flatlaf.icons.FlatHelpButtonIcon;
|
||||
@@ -551,9 +553,45 @@ public class FlatButtonUI
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Similar to BasicButtonUI.paint(), but does not use zero insets for HTML text,
|
||||
* which is done in BasicButtonUI.layout() since Java 19.
|
||||
* See https://github.com/openjdk/jdk/pull/8407
|
||||
* and https://github.com/openjdk/jdk/pull/8407#issuecomment-1761583430
|
||||
*/
|
||||
@Override
|
||||
public void paint( Graphics g, JComponent c ) {
|
||||
super.paint( FlatLabelUI.createGraphicsHTMLTextYCorrection( g, c ), c );
|
||||
g = FlatLabelUI.createGraphicsHTMLTextYCorrection( g, c );
|
||||
|
||||
AbstractButton b = (AbstractButton) c;
|
||||
|
||||
// layout
|
||||
String clippedText = layout( b, b.getFontMetrics( b.getFont() ), b.getWidth(), b.getHeight() );
|
||||
|
||||
// not used in FlatLaf, but invoked for compatibility with BasicButtonUI.paint()
|
||||
clearTextShiftOffset();
|
||||
|
||||
// not used in FlatLaf, but invoked for compatibility with BasicButtonUI.paint()
|
||||
ButtonModel model = b.getModel();
|
||||
if( model.isArmed() && model.isPressed() )
|
||||
paintButtonPressed( g, b );
|
||||
|
||||
// paint icon
|
||||
if( b.getIcon() != null )
|
||||
paintIcon( g, b, iconR );
|
||||
|
||||
// paint text
|
||||
if( clippedText != null && !clippedText.isEmpty() ) {
|
||||
View view = (View) b.getClientProperty( BasicHTML.propertyKey );
|
||||
if( view != null )
|
||||
view.paint( g, textR ); // HTML text
|
||||
else
|
||||
paintText( g, b, textR, clippedText );
|
||||
}
|
||||
|
||||
// not used in FlatLaf, but invoked for compatibility with BasicButtonUI.paint()
|
||||
if( b.isFocusPainted() && b.hasFocus() )
|
||||
paintFocus( g, b, viewR, textR, iconR );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -786,6 +824,67 @@ public class FlatButtonUI
|
||||
return margin instanceof UIResource && Objects.equals( margin, defaultMargin );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBaseline( JComponent c, int width, int height ) {
|
||||
return getBaselineImpl( c, width, height );
|
||||
}
|
||||
|
||||
/**
|
||||
* Similar to BasicButtonUI.getBaseline(), but does not use zero insets for HTML text,
|
||||
* which is done in BasicButtonUI.layout() since Java 19.
|
||||
* See https://github.com/openjdk/jdk/pull/8407
|
||||
* and https://github.com/openjdk/jdk/pull/8407#issuecomment-1761583430
|
||||
*/
|
||||
static int getBaselineImpl( JComponent c, int width, int height ) {
|
||||
if( width < 0 || height < 0 )
|
||||
throw new IllegalArgumentException();
|
||||
|
||||
AbstractButton b = (AbstractButton) c;
|
||||
String text = b.getText();
|
||||
if( text == null || text.isEmpty() )
|
||||
return -1;
|
||||
|
||||
FontMetrics fm = b.getFontMetrics( b.getFont() );
|
||||
layout( b, fm, width, height );
|
||||
|
||||
View view = (View) b.getClientProperty( BasicHTML.propertyKey );
|
||||
if( view != null ) {
|
||||
// HTML text
|
||||
int baseline = BasicHTML.getHTMLBaseline( view, textR.width, textR.height );
|
||||
return (baseline >= 0) ? textR.y + baseline : baseline;
|
||||
} else
|
||||
return textR.y + fm.getAscent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Similar to BasicButtonUI.layout(), but does not use zero insets for HTML text,
|
||||
* which is done in BasicButtonUI.layout() since Java 19.
|
||||
* See https://github.com/openjdk/jdk/pull/8407
|
||||
* and https://github.com/openjdk/jdk/pull/8407#issuecomment-1761583430
|
||||
*/
|
||||
private static String layout( AbstractButton b, FontMetrics fm, int width, int height ) {
|
||||
// compute view rectangle
|
||||
Insets insets = b.getInsets();
|
||||
viewR.setBounds( insets.left, insets.top,
|
||||
width - insets.left - insets.right,
|
||||
height - insets.top - insets.bottom );
|
||||
|
||||
// reset rectangles
|
||||
textR.setBounds( 0, 0, 0, 0 );
|
||||
iconR.setBounds( 0, 0, 0, 0 );
|
||||
|
||||
String text = b.getText();
|
||||
return SwingUtilities.layoutCompoundLabel( b, fm, text, b.getIcon(),
|
||||
b.getVerticalAlignment(), b.getHorizontalAlignment(),
|
||||
b.getVerticalTextPosition(), b.getHorizontalTextPosition(),
|
||||
viewR, iconR, textR,
|
||||
(text != null) ? b.getIconTextGap() : 0 );
|
||||
}
|
||||
|
||||
private static Rectangle viewR = new Rectangle();
|
||||
private static Rectangle textR = new Rectangle();
|
||||
private static Rectangle iconR = new Rectangle();
|
||||
|
||||
//---- class FlatButtonListener -------------------------------------------
|
||||
|
||||
protected class FlatButtonListener
|
||||
|
||||
@@ -555,10 +555,12 @@ public class FlatFileChooserUI
|
||||
return new ImageIcon( image );
|
||||
}
|
||||
}
|
||||
} catch( IllegalAccessException ex ) {
|
||||
// do not log because access may be denied via VM option '--illegal-access=deny'
|
||||
} catch( Exception ex ) {
|
||||
LoggingFacade.INSTANCE.logSevere( null, ex );
|
||||
// do not log InaccessibleObjectException because access
|
||||
// may be denied via VM option '--illegal-access=deny' (default in Java 16)
|
||||
// (not catching InaccessibleObjectException here because it is new in Java 9, but FlatLaf also runs on Java 8)
|
||||
if( !"java.lang.reflect.InaccessibleObjectException".equals( ex.getClass().getName() ) )
|
||||
LoggingFacade.INSTANCE.logSevere( null, ex );
|
||||
}
|
||||
|
||||
// get system icon in default size 16x16
|
||||
|
||||
@@ -35,6 +35,7 @@ import javax.swing.CellRendererPane;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.LookAndFeel;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
@@ -278,20 +279,27 @@ public class FlatRadioButtonUI
|
||||
int focusWidth = getIconFocusWidth( c );
|
||||
if( focusWidth > 0 ) {
|
||||
boolean ltr = c.getComponentOrientation().isLeftToRight();
|
||||
int halign = ((AbstractButton)c).getHorizontalAlignment();
|
||||
if( halign == SwingConstants.LEADING )
|
||||
halign = ltr ? SwingConstants.LEFT : SwingConstants.RIGHT;
|
||||
else if( halign == SwingConstants.TRAILING )
|
||||
halign = ltr ? SwingConstants.RIGHT : SwingConstants.LEFT;
|
||||
|
||||
Insets insets = c.getInsets( tempInsets );
|
||||
int leftOrRightInset = ltr ? insets.left : insets.right;
|
||||
if( focusWidth > leftOrRightInset ) {
|
||||
if( (focusWidth > insets.left || focusWidth > insets.right) &&
|
||||
(halign == SwingConstants.LEFT || halign == SwingConstants.RIGHT) )
|
||||
{
|
||||
// The left (or right) inset is smaller than the focus width, which may be
|
||||
// the case if insets were explicitly reduced (e.g. with an EmptyBorder).
|
||||
// In this case the width has been increased in getPreferredSize() and
|
||||
// here it is necessary to fix icon and text painting location.
|
||||
int offset = focusWidth - leftOrRightInset;
|
||||
if( !ltr )
|
||||
offset = -offset;
|
||||
int offset = (halign == SwingConstants.LEFT)
|
||||
? Math.max( focusWidth - insets.left, 0 )
|
||||
: -Math.max( focusWidth - insets.right, 0 );
|
||||
|
||||
// move the graphics origin to the left (or right)
|
||||
g.translate( offset, 0 );
|
||||
super.paint( g, c );
|
||||
super.paint( FlatLabelUI.createGraphicsHTMLTextYCorrection( g, c ), c );
|
||||
g.translate( -offset, 0 );
|
||||
return;
|
||||
}
|
||||
@@ -328,6 +336,11 @@ public class FlatRadioButtonUI
|
||||
: 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBaseline( JComponent c, int width, int height ) {
|
||||
return FlatButtonUI.getBaselineImpl( c, width, height );
|
||||
}
|
||||
|
||||
//---- class FlatRadioButtonListener --------------------------------------
|
||||
|
||||
/** @since 2 */
|
||||
|
||||
@@ -3567,7 +3567,7 @@ public class FlatTabbedPaneUI
|
||||
//---- class FlatSelectedTabRepainter -------------------------------------
|
||||
|
||||
private static class FlatSelectedTabRepainter
|
||||
implements PropertyChangeListener//, Runnable
|
||||
implements PropertyChangeListener
|
||||
{
|
||||
private static FlatSelectedTabRepainter instance;
|
||||
|
||||
@@ -3617,17 +3617,31 @@ public class FlatTabbedPaneUI
|
||||
break;
|
||||
|
||||
case "activeWindow":
|
||||
repaintSelectedTabs( keyboardFocusManager.getPermanentFocusOwner() );
|
||||
Component permanentFocusOwner = keyboardFocusManager.getPermanentFocusOwner();
|
||||
if( permanentFocusOwner != null )
|
||||
repaintSelectedTabs( permanentFocusOwner );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void repaintSelectedTabs( Component c ) {
|
||||
if( c instanceof JTabbedPane )
|
||||
repaintSelectedTab( (JTabbedPane) c );
|
||||
// Use invokeLater because this method may be invoked while UI update
|
||||
// is in progress. This may happen if a focusable component (e.g. text field)
|
||||
// is used as tab component (see JTabbedPane.setTabComponentAt()).
|
||||
// uninstallTabContainer() removes all components from tabbed pane and
|
||||
// the text field looses focus.
|
||||
EventQueue.invokeLater( () -> {
|
||||
// because this is invoked later, check whether component is still displayable
|
||||
if( !c.isDisplayable() )
|
||||
return;
|
||||
|
||||
while( (c = SwingUtilities.getAncestorOfClass( JTabbedPane.class, c )) != null )
|
||||
repaintSelectedTab( (JTabbedPane) c );
|
||||
if( c instanceof JTabbedPane )
|
||||
repaintSelectedTab( (JTabbedPane) c );
|
||||
|
||||
Component c2 = c;
|
||||
while( (c2 = SwingUtilities.getAncestorOfClass( JTabbedPane.class, c2 )) != null )
|
||||
repaintSelectedTab( (JTabbedPane) c2 );
|
||||
} );
|
||||
}
|
||||
|
||||
private void repaintSelectedTab( JTabbedPane tabbedPane ) {
|
||||
|
||||
@@ -0,0 +1,446 @@
|
||||
/*
|
||||
* Copyright 2023 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
|
||||
*
|
||||
* https://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.testing;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.function.Predicate;
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.*;
|
||||
import com.formdev.flatlaf.FlatClientProperties;
|
||||
import net.miginfocom.swing.*;
|
||||
|
||||
/**
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
public class FlatRadioButtonsTest
|
||||
extends FlatTestPanel
|
||||
{
|
||||
public static void main( String[] args ) {
|
||||
SwingUtilities.invokeLater( () -> {
|
||||
FlatTestFrame frame = FlatTestFrame.create( args, "FlatRadioButtonsTest" );
|
||||
frame.showFrame( FlatRadioButtonsTest::new );
|
||||
} );
|
||||
}
|
||||
|
||||
FlatRadioButtonsTest() {
|
||||
initComponents();
|
||||
focusAll();
|
||||
}
|
||||
|
||||
private void focusAll() {
|
||||
boolean focusAll = focusAllCheckBox.isSelected();
|
||||
for( Component c : getComponents() ) {
|
||||
if( c instanceof JRadioButton )
|
||||
((JRadioButton) c).putClientProperty( FlatClientProperties.COMPONENT_FOCUS_OWNER,
|
||||
focusAll ? (Predicate<JComponent>) comp -> true : null );
|
||||
}
|
||||
repaint();
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
|
||||
JLabel label5 = new JLabel();
|
||||
JLabel label6 = new JLabel();
|
||||
JLabel label1 = new JLabel();
|
||||
JLabel label3 = new JLabel();
|
||||
JLabel label13 = new JLabel();
|
||||
JLabel label14 = new JLabel();
|
||||
JLabel label7 = new JLabel();
|
||||
JRadioButton radioButton1 = new JRadioButton();
|
||||
JRadioButton radioButton13 = new JRadioButton();
|
||||
JRadioButton radioButton7 = new JRadioButton();
|
||||
JRadioButton radioButton19 = new JRadioButton();
|
||||
JRadioButton radioButton25 = new JRadioButton();
|
||||
JRadioButton radioButton31 = new JRadioButton();
|
||||
JLabel label8 = new JLabel();
|
||||
JRadioButton radioButton2 = new JRadioButton();
|
||||
JRadioButton radioButton14 = new JRadioButton();
|
||||
JRadioButton radioButton8 = new JRadioButton();
|
||||
JRadioButton radioButton20 = new JRadioButton();
|
||||
JRadioButton radioButton26 = new JRadioButton();
|
||||
JRadioButton radioButton32 = new JRadioButton();
|
||||
JLabel label9 = new JLabel();
|
||||
JRadioButton radioButton3 = new JRadioButton();
|
||||
JRadioButton radioButton15 = new JRadioButton();
|
||||
JRadioButton radioButton9 = new JRadioButton();
|
||||
JRadioButton radioButton21 = new JRadioButton();
|
||||
JRadioButton radioButton27 = new JRadioButton();
|
||||
JRadioButton radioButton33 = new JRadioButton();
|
||||
JLabel label2 = new JLabel();
|
||||
JLabel label4 = new JLabel();
|
||||
JLabel label10 = new JLabel();
|
||||
JRadioButton radioButton4 = new JRadioButton();
|
||||
JRadioButton radioButton16 = new JRadioButton();
|
||||
JRadioButton radioButton10 = new JRadioButton();
|
||||
JRadioButton radioButton22 = new JRadioButton();
|
||||
JRadioButton radioButton28 = new JRadioButton();
|
||||
JRadioButton radioButton34 = new JRadioButton();
|
||||
JLabel label11 = new JLabel();
|
||||
JRadioButton radioButton5 = new JRadioButton();
|
||||
JRadioButton radioButton17 = new JRadioButton();
|
||||
JRadioButton radioButton11 = new JRadioButton();
|
||||
JRadioButton radioButton23 = new JRadioButton();
|
||||
JRadioButton radioButton29 = new JRadioButton();
|
||||
JRadioButton radioButton35 = new JRadioButton();
|
||||
JLabel label12 = new JLabel();
|
||||
JRadioButton radioButton6 = new JRadioButton();
|
||||
JRadioButton radioButton18 = new JRadioButton();
|
||||
JRadioButton radioButton12 = new JRadioButton();
|
||||
JRadioButton radioButton24 = new JRadioButton();
|
||||
JRadioButton radioButton30 = new JRadioButton();
|
||||
JRadioButton radioButton36 = new JRadioButton();
|
||||
focusAllCheckBox = new JCheckBox();
|
||||
|
||||
//======== this ========
|
||||
setBackground(new Color(0xe0e0e0));
|
||||
setLayout(new MigLayout(
|
||||
"ltr,insets dialog,hidemode 3",
|
||||
// columns
|
||||
"[fill]" +
|
||||
"[80,fill]para" +
|
||||
"[]para" +
|
||||
"[80,fill]" +
|
||||
"[]para" +
|
||||
"[70,fill]" +
|
||||
"[70,fill]",
|
||||
// rows
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]para" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[grow]" +
|
||||
"[]"));
|
||||
|
||||
//---- label5 ----
|
||||
label5.setText("Default Border");
|
||||
add(label5, "cell 1 0");
|
||||
|
||||
//---- label6 ----
|
||||
label6.setText("Empty Border");
|
||||
add(label6, "cell 3 0");
|
||||
|
||||
//---- label1 ----
|
||||
label1.setText("horzTextPos TRAILING");
|
||||
add(label1, "cell 1 1 2 1");
|
||||
|
||||
//---- label3 ----
|
||||
label3.setText("horzTextPos TRAILING");
|
||||
add(label3, "cell 3 1 2 1");
|
||||
|
||||
//---- label13 ----
|
||||
label13.setText("left 20, right 0");
|
||||
add(label13, "cell 5 1");
|
||||
|
||||
//---- label14 ----
|
||||
label14.setText("left 0, right 20");
|
||||
add(label14, "cell 6 1");
|
||||
|
||||
//---- label7 ----
|
||||
label7.setText("hAlign LEADING");
|
||||
add(label7, "cell 0 2");
|
||||
|
||||
//---- radioButton1 ----
|
||||
radioButton1.setText("text");
|
||||
radioButton1.setOpaque(true);
|
||||
add(radioButton1, "cell 1 2");
|
||||
|
||||
//---- radioButton13 ----
|
||||
radioButton13.setText("text");
|
||||
radioButton13.setOpaque(true);
|
||||
add(radioButton13, "cell 2 2");
|
||||
|
||||
//---- radioButton7 ----
|
||||
radioButton7.setText("text");
|
||||
radioButton7.setOpaque(true);
|
||||
radioButton7.setBorder(BorderFactory.createEmptyBorder());
|
||||
add(radioButton7, "cell 3 2");
|
||||
|
||||
//---- radioButton19 ----
|
||||
radioButton19.setText("text");
|
||||
radioButton19.setOpaque(true);
|
||||
radioButton19.setBorder(BorderFactory.createEmptyBorder());
|
||||
add(radioButton19, "cell 4 2");
|
||||
|
||||
//---- radioButton25 ----
|
||||
radioButton25.setText("text");
|
||||
radioButton25.setOpaque(true);
|
||||
radioButton25.setBorder(new EmptyBorder(0, 20, 0, 0));
|
||||
add(radioButton25, "cell 5 2");
|
||||
|
||||
//---- radioButton31 ----
|
||||
radioButton31.setText("text");
|
||||
radioButton31.setOpaque(true);
|
||||
radioButton31.setBorder(new EmptyBorder(0, 0, 0, 20));
|
||||
add(radioButton31, "cell 6 2");
|
||||
|
||||
//---- label8 ----
|
||||
label8.setText("hAlign CENTER");
|
||||
add(label8, "cell 0 3");
|
||||
|
||||
//---- radioButton2 ----
|
||||
radioButton2.setText("text");
|
||||
radioButton2.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
radioButton2.setOpaque(true);
|
||||
add(radioButton2, "cell 1 3");
|
||||
|
||||
//---- radioButton14 ----
|
||||
radioButton14.setText("text");
|
||||
radioButton14.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
radioButton14.setOpaque(true);
|
||||
add(radioButton14, "cell 2 3");
|
||||
|
||||
//---- radioButton8 ----
|
||||
radioButton8.setText("text");
|
||||
radioButton8.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
radioButton8.setOpaque(true);
|
||||
radioButton8.setBorder(BorderFactory.createEmptyBorder());
|
||||
add(radioButton8, "cell 3 3");
|
||||
|
||||
//---- radioButton20 ----
|
||||
radioButton20.setText("text");
|
||||
radioButton20.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
radioButton20.setOpaque(true);
|
||||
radioButton20.setBorder(BorderFactory.createEmptyBorder());
|
||||
add(radioButton20, "cell 4 3");
|
||||
|
||||
//---- radioButton26 ----
|
||||
radioButton26.setText("text");
|
||||
radioButton26.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
radioButton26.setOpaque(true);
|
||||
radioButton26.setBorder(new EmptyBorder(0, 20, 0, 0));
|
||||
add(radioButton26, "cell 5 3");
|
||||
|
||||
//---- radioButton32 ----
|
||||
radioButton32.setText("text");
|
||||
radioButton32.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
radioButton32.setOpaque(true);
|
||||
radioButton32.setBorder(new EmptyBorder(0, 0, 0, 20));
|
||||
add(radioButton32, "cell 6 3");
|
||||
|
||||
//---- label9 ----
|
||||
label9.setText("hAlign TRAILING");
|
||||
add(label9, "cell 0 4");
|
||||
|
||||
//---- radioButton3 ----
|
||||
radioButton3.setText("text");
|
||||
radioButton3.setHorizontalAlignment(SwingConstants.TRAILING);
|
||||
radioButton3.setOpaque(true);
|
||||
add(radioButton3, "cell 1 4");
|
||||
|
||||
//---- radioButton15 ----
|
||||
radioButton15.setText("text");
|
||||
radioButton15.setHorizontalAlignment(SwingConstants.TRAILING);
|
||||
radioButton15.setOpaque(true);
|
||||
add(radioButton15, "cell 2 4");
|
||||
|
||||
//---- radioButton9 ----
|
||||
radioButton9.setText("text");
|
||||
radioButton9.setHorizontalAlignment(SwingConstants.TRAILING);
|
||||
radioButton9.setOpaque(true);
|
||||
radioButton9.setBorder(BorderFactory.createEmptyBorder());
|
||||
add(radioButton9, "cell 3 4");
|
||||
|
||||
//---- radioButton21 ----
|
||||
radioButton21.setText("text");
|
||||
radioButton21.setHorizontalAlignment(SwingConstants.TRAILING);
|
||||
radioButton21.setOpaque(true);
|
||||
radioButton21.setBorder(BorderFactory.createEmptyBorder());
|
||||
add(radioButton21, "cell 4 4");
|
||||
|
||||
//---- radioButton27 ----
|
||||
radioButton27.setText("text");
|
||||
radioButton27.setHorizontalAlignment(SwingConstants.TRAILING);
|
||||
radioButton27.setOpaque(true);
|
||||
radioButton27.setBorder(new EmptyBorder(0, 20, 0, 0));
|
||||
add(radioButton27, "cell 5 4");
|
||||
|
||||
//---- radioButton33 ----
|
||||
radioButton33.setText("text");
|
||||
radioButton33.setHorizontalAlignment(SwingConstants.TRAILING);
|
||||
radioButton33.setOpaque(true);
|
||||
radioButton33.setBorder(new EmptyBorder(0, 0, 0, 20));
|
||||
add(radioButton33, "cell 6 4");
|
||||
|
||||
//---- label2 ----
|
||||
label2.setText("horzTextPos LEADING");
|
||||
add(label2, "cell 1 5 2 1");
|
||||
|
||||
//---- label4 ----
|
||||
label4.setText("horzTextPos LEADING");
|
||||
add(label4, "cell 3 5 2 1");
|
||||
|
||||
//---- label10 ----
|
||||
label10.setText("hAlign LEADING");
|
||||
add(label10, "cell 0 6");
|
||||
|
||||
//---- radioButton4 ----
|
||||
radioButton4.setText("text");
|
||||
radioButton4.setOpaque(true);
|
||||
radioButton4.setHorizontalTextPosition(SwingConstants.LEADING);
|
||||
add(radioButton4, "cell 1 6");
|
||||
|
||||
//---- radioButton16 ----
|
||||
radioButton16.setText("text");
|
||||
radioButton16.setOpaque(true);
|
||||
radioButton16.setHorizontalTextPosition(SwingConstants.LEADING);
|
||||
add(radioButton16, "cell 2 6");
|
||||
|
||||
//---- radioButton10 ----
|
||||
radioButton10.setText("text");
|
||||
radioButton10.setOpaque(true);
|
||||
radioButton10.setHorizontalTextPosition(SwingConstants.LEADING);
|
||||
radioButton10.setBorder(BorderFactory.createEmptyBorder());
|
||||
add(radioButton10, "cell 3 6");
|
||||
|
||||
//---- radioButton22 ----
|
||||
radioButton22.setText("text");
|
||||
radioButton22.setOpaque(true);
|
||||
radioButton22.setHorizontalTextPosition(SwingConstants.LEADING);
|
||||
radioButton22.setBorder(BorderFactory.createEmptyBorder());
|
||||
add(radioButton22, "cell 4 6");
|
||||
|
||||
//---- radioButton28 ----
|
||||
radioButton28.setText("text");
|
||||
radioButton28.setOpaque(true);
|
||||
radioButton28.setHorizontalTextPosition(SwingConstants.LEADING);
|
||||
radioButton28.setBorder(new EmptyBorder(0, 20, 0, 0));
|
||||
add(radioButton28, "cell 5 6");
|
||||
|
||||
//---- radioButton34 ----
|
||||
radioButton34.setText("text");
|
||||
radioButton34.setOpaque(true);
|
||||
radioButton34.setHorizontalTextPosition(SwingConstants.LEADING);
|
||||
radioButton34.setBorder(new EmptyBorder(0, 0, 0, 20));
|
||||
add(radioButton34, "cell 6 6");
|
||||
|
||||
//---- label11 ----
|
||||
label11.setText("hAlign CENTER");
|
||||
add(label11, "cell 0 7");
|
||||
|
||||
//---- radioButton5 ----
|
||||
radioButton5.setText("text");
|
||||
radioButton5.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
radioButton5.setOpaque(true);
|
||||
radioButton5.setHorizontalTextPosition(SwingConstants.LEADING);
|
||||
add(radioButton5, "cell 1 7");
|
||||
|
||||
//---- radioButton17 ----
|
||||
radioButton17.setText("text");
|
||||
radioButton17.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
radioButton17.setOpaque(true);
|
||||
radioButton17.setHorizontalTextPosition(SwingConstants.LEADING);
|
||||
add(radioButton17, "cell 2 7");
|
||||
|
||||
//---- radioButton11 ----
|
||||
radioButton11.setText("text");
|
||||
radioButton11.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
radioButton11.setOpaque(true);
|
||||
radioButton11.setHorizontalTextPosition(SwingConstants.LEADING);
|
||||
radioButton11.setBorder(BorderFactory.createEmptyBorder());
|
||||
add(radioButton11, "cell 3 7");
|
||||
|
||||
//---- radioButton23 ----
|
||||
radioButton23.setText("text");
|
||||
radioButton23.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
radioButton23.setOpaque(true);
|
||||
radioButton23.setHorizontalTextPosition(SwingConstants.LEADING);
|
||||
radioButton23.setBorder(BorderFactory.createEmptyBorder());
|
||||
add(radioButton23, "cell 4 7");
|
||||
|
||||
//---- radioButton29 ----
|
||||
radioButton29.setText("text");
|
||||
radioButton29.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
radioButton29.setOpaque(true);
|
||||
radioButton29.setHorizontalTextPosition(SwingConstants.LEADING);
|
||||
radioButton29.setBorder(new EmptyBorder(0, 20, 0, 0));
|
||||
add(radioButton29, "cell 5 7");
|
||||
|
||||
//---- radioButton35 ----
|
||||
radioButton35.setText("text");
|
||||
radioButton35.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
radioButton35.setOpaque(true);
|
||||
radioButton35.setHorizontalTextPosition(SwingConstants.LEADING);
|
||||
radioButton35.setBorder(new EmptyBorder(0, 0, 0, 20));
|
||||
add(radioButton35, "cell 6 7");
|
||||
|
||||
//---- label12 ----
|
||||
label12.setText("hAlign TRAILING");
|
||||
add(label12, "cell 0 8");
|
||||
|
||||
//---- radioButton6 ----
|
||||
radioButton6.setText("text");
|
||||
radioButton6.setHorizontalAlignment(SwingConstants.TRAILING);
|
||||
radioButton6.setOpaque(true);
|
||||
radioButton6.setHorizontalTextPosition(SwingConstants.LEADING);
|
||||
add(radioButton6, "cell 1 8");
|
||||
|
||||
//---- radioButton18 ----
|
||||
radioButton18.setText("text");
|
||||
radioButton18.setHorizontalAlignment(SwingConstants.TRAILING);
|
||||
radioButton18.setOpaque(true);
|
||||
radioButton18.setHorizontalTextPosition(SwingConstants.LEADING);
|
||||
add(radioButton18, "cell 2 8");
|
||||
|
||||
//---- radioButton12 ----
|
||||
radioButton12.setText("text");
|
||||
radioButton12.setHorizontalAlignment(SwingConstants.TRAILING);
|
||||
radioButton12.setOpaque(true);
|
||||
radioButton12.setHorizontalTextPosition(SwingConstants.LEADING);
|
||||
radioButton12.setBorder(BorderFactory.createEmptyBorder());
|
||||
add(radioButton12, "cell 3 8");
|
||||
|
||||
//---- radioButton24 ----
|
||||
radioButton24.setText("text");
|
||||
radioButton24.setHorizontalAlignment(SwingConstants.TRAILING);
|
||||
radioButton24.setOpaque(true);
|
||||
radioButton24.setHorizontalTextPosition(SwingConstants.LEADING);
|
||||
radioButton24.setBorder(BorderFactory.createEmptyBorder());
|
||||
add(radioButton24, "cell 4 8");
|
||||
|
||||
//---- radioButton30 ----
|
||||
radioButton30.setText("text");
|
||||
radioButton30.setHorizontalAlignment(SwingConstants.TRAILING);
|
||||
radioButton30.setOpaque(true);
|
||||
radioButton30.setHorizontalTextPosition(SwingConstants.LEADING);
|
||||
radioButton30.setBorder(new EmptyBorder(0, 20, 0, 0));
|
||||
add(radioButton30, "cell 5 8");
|
||||
|
||||
//---- radioButton36 ----
|
||||
radioButton36.setText("text");
|
||||
radioButton36.setHorizontalAlignment(SwingConstants.TRAILING);
|
||||
radioButton36.setOpaque(true);
|
||||
radioButton36.setHorizontalTextPosition(SwingConstants.LEADING);
|
||||
radioButton36.setBorder(new EmptyBorder(0, 0, 0, 20));
|
||||
add(radioButton36, "cell 6 8");
|
||||
|
||||
//---- focusAllCheckBox ----
|
||||
focusAllCheckBox.setText("focus all");
|
||||
focusAllCheckBox.setSelected(true);
|
||||
focusAllCheckBox.addActionListener(e -> focusAll());
|
||||
add(focusAllCheckBox, "cell 0 10,alignx left,growx 0");
|
||||
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
||||
}
|
||||
|
||||
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
|
||||
private JCheckBox focusAllCheckBox;
|
||||
// JFormDesigner - End of variables declaration //GEN-END:variables
|
||||
}
|
||||
@@ -0,0 +1,434 @@
|
||||
JFDML JFormDesigner: "8.1.0.0.283" Java: "19.0.2" encoding: "UTF-8"
|
||||
|
||||
new FormModel {
|
||||
contentType: "form/swing"
|
||||
root: new FormRoot {
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.defaultVariableLocal": true
|
||||
}
|
||||
add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||
"$layoutConstraints": "ltr,insets dialog,hidemode 3"
|
||||
"$columnConstraints": "[fill][80,fill]para[]para[80,fill][]para[70,fill][70,fill]"
|
||||
"$rowConstraints": "[][][][][]para[][][][][grow][]"
|
||||
} ) {
|
||||
name: "this"
|
||||
"background": new java.awt.Color( 224, 224, 224, 255 )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "label5"
|
||||
"text": "Default Border"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "label6"
|
||||
"text": "Empty Border"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 3 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "label1"
|
||||
"text": "horzTextPos TRAILING"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 1 2 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "label3"
|
||||
"text": "horzTextPos TRAILING"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 3 1 2 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "label13"
|
||||
"text": "left 20, right 0"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 5 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "label14"
|
||||
"text": "left 0, right 20"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 6 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "label7"
|
||||
"text": "hAlign LEADING"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 2"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton1"
|
||||
"text": "text"
|
||||
"opaque": true
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 2"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton13"
|
||||
"text": "text"
|
||||
"opaque": true
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 2"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton7"
|
||||
"text": "text"
|
||||
"opaque": true
|
||||
"border": &EmptyBorder0 new javax.swing.border.EmptyBorder( 0, 0, 0, 0 )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 3 2"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton19"
|
||||
"text": "text"
|
||||
"opaque": true
|
||||
"border": #EmptyBorder0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 4 2"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton25"
|
||||
"text": "text"
|
||||
"opaque": true
|
||||
"border": new javax.swing.border.EmptyBorder( 0, 20, 0, 0 )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 5 2"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton31"
|
||||
"text": "text"
|
||||
"opaque": true
|
||||
"border": &EmptyBorder1 new javax.swing.border.EmptyBorder( 0, 0, 0, 20 )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 6 2"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "label8"
|
||||
"text": "hAlign CENTER"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 3"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton2"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 0
|
||||
"opaque": true
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 3"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton14"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 0
|
||||
"opaque": true
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 3"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton8"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 0
|
||||
"opaque": true
|
||||
"border": #EmptyBorder0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 3 3"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton20"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 0
|
||||
"opaque": true
|
||||
"border": #EmptyBorder0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 4 3"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton26"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 0
|
||||
"opaque": true
|
||||
"border": &EmptyBorder2 new javax.swing.border.EmptyBorder( 0, 20, 0, 0 )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 5 3"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton32"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 0
|
||||
"opaque": true
|
||||
"border": #EmptyBorder1
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 6 3"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "label9"
|
||||
"text": "hAlign TRAILING"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 4"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton3"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 11
|
||||
"opaque": true
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 4"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton15"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 11
|
||||
"opaque": true
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 4"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton9"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 11
|
||||
"opaque": true
|
||||
"border": #EmptyBorder0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 3 4"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton21"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 11
|
||||
"opaque": true
|
||||
"border": #EmptyBorder0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 4 4"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton27"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 11
|
||||
"opaque": true
|
||||
"border": #EmptyBorder2
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 5 4"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton33"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 11
|
||||
"opaque": true
|
||||
"border": #EmptyBorder1
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 6 4"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "label2"
|
||||
"text": "horzTextPos LEADING"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 5 2 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "label4"
|
||||
"text": "horzTextPos LEADING"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 3 5 2 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "label10"
|
||||
"text": "hAlign LEADING"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 6"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton4"
|
||||
"text": "text"
|
||||
"opaque": true
|
||||
"horizontalTextPosition": 10
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 6"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton16"
|
||||
"text": "text"
|
||||
"opaque": true
|
||||
"horizontalTextPosition": 10
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 6"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton10"
|
||||
"text": "text"
|
||||
"opaque": true
|
||||
"horizontalTextPosition": 10
|
||||
"border": #EmptyBorder0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 3 6"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton22"
|
||||
"text": "text"
|
||||
"opaque": true
|
||||
"horizontalTextPosition": 10
|
||||
"border": #EmptyBorder0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 4 6"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton28"
|
||||
"text": "text"
|
||||
"opaque": true
|
||||
"horizontalTextPosition": 10
|
||||
"border": #EmptyBorder2
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 5 6"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton34"
|
||||
"text": "text"
|
||||
"opaque": true
|
||||
"horizontalTextPosition": 10
|
||||
"border": #EmptyBorder1
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 6 6"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "label11"
|
||||
"text": "hAlign CENTER"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 7"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton5"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 0
|
||||
"opaque": true
|
||||
"horizontalTextPosition": 10
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 7"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton17"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 0
|
||||
"opaque": true
|
||||
"horizontalTextPosition": 10
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 7"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton11"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 0
|
||||
"opaque": true
|
||||
"horizontalTextPosition": 10
|
||||
"border": #EmptyBorder0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 3 7"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton23"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 0
|
||||
"opaque": true
|
||||
"horizontalTextPosition": 10
|
||||
"border": #EmptyBorder0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 4 7"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton29"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 0
|
||||
"opaque": true
|
||||
"horizontalTextPosition": 10
|
||||
"border": #EmptyBorder2
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 5 7"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton35"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 0
|
||||
"opaque": true
|
||||
"horizontalTextPosition": 10
|
||||
"border": #EmptyBorder1
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 6 7"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "label12"
|
||||
"text": "hAlign TRAILING"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 8"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton6"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 11
|
||||
"opaque": true
|
||||
"horizontalTextPosition": 10
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 8"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton18"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 11
|
||||
"opaque": true
|
||||
"horizontalTextPosition": 10
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 8"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton12"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 11
|
||||
"opaque": true
|
||||
"horizontalTextPosition": 10
|
||||
"border": #EmptyBorder0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 3 8"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton24"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 11
|
||||
"opaque": true
|
||||
"horizontalTextPosition": 10
|
||||
"border": #EmptyBorder0
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 4 8"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton30"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 11
|
||||
"opaque": true
|
||||
"horizontalTextPosition": 10
|
||||
"border": #EmptyBorder2
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 5 8"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "radioButton36"
|
||||
"text": "text"
|
||||
"horizontalAlignment": 11
|
||||
"opaque": true
|
||||
"horizontalTextPosition": 10
|
||||
"border": #EmptyBorder1
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 6 8"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||
name: "focusAllCheckBox"
|
||||
"text": "focus all"
|
||||
"selected": true
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "focusAll", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 10,alignx left,growx 0"
|
||||
} )
|
||||
}, new FormLayoutConstraints( null ) {
|
||||
"location": new java.awt.Point( 0, 0 )
|
||||
"size": new java.awt.Dimension( 580, 405 )
|
||||
} )
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.formdev.flatlaf.testing.jdk;
|
||||
|
||||
import java.awt.*;
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.*;
|
||||
import com.formdev.flatlaf.FlatLightLaf;
|
||||
|
||||
/**
|
||||
* https://github.com/openjdk/jdk/pull/8407#issuecomment-1761583430
|
||||
*/
|
||||
public class HtmlButtonTest
|
||||
{
|
||||
public static void main( String[] args ) {
|
||||
SwingUtilities.invokeLater( () -> {
|
||||
FlatLightLaf.setup();
|
||||
|
||||
JFrame frame = new JFrame( "HTML Button Test" );
|
||||
frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
|
||||
|
||||
JPanel panel = new JPanel( new GridBagLayout() );
|
||||
panel.setBorder( new EmptyBorder( 20, 20, 20, 20 ) );
|
||||
|
||||
createButtons( panel, "center", SwingConstants.CENTER, SwingConstants.CENTER, null );
|
||||
createButtons( panel, "left", SwingConstants.LEFT, SwingConstants.CENTER, null );
|
||||
createButtons( panel, "right", SwingConstants.RIGHT, SwingConstants.CENTER, null );
|
||||
|
||||
createButtons( panel, "center with margin 30,4,4,4", SwingConstants.CENTER, SwingConstants.CENTER, new Insets( 30, 4, 4, 4 ) );
|
||||
createButtons( panel, "left with margin 30,4,4,4", SwingConstants.LEFT, SwingConstants.CENTER, new Insets( 30, 4, 4, 4 ) );
|
||||
createButtons( panel, "left/top with margin 30,4,4,4", SwingConstants.LEFT, SwingConstants.TOP, new Insets( 30, 4, 4, 4 ) );
|
||||
|
||||
frame.add( new JLabel( "Java version " + System.getProperty( "java.version" ) ), BorderLayout.NORTH );
|
||||
frame.add( panel );
|
||||
frame.pack();
|
||||
frame.setVisible( true );
|
||||
} );
|
||||
}
|
||||
|
||||
private static void createButtons( JPanel panel, String text, int horizontalAlignment, int verticalAlignment, Insets margin ) {
|
||||
JButton button = new JButton( text );
|
||||
button.setHorizontalAlignment( horizontalAlignment );
|
||||
button.setVerticalAlignment( verticalAlignment );
|
||||
if( margin != null )
|
||||
button.setMargin( margin );
|
||||
panel.add( button, new GridBagConstraints( 0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0,
|
||||
GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets( 4, 4, 4, 4 ), 0, 0 ) );
|
||||
|
||||
JButton htmlButton = new JButton( "<html>HTML " + text + "</html>" );
|
||||
htmlButton.setHorizontalAlignment( horizontalAlignment );
|
||||
htmlButton.setVerticalAlignment( verticalAlignment );
|
||||
if( margin != null )
|
||||
htmlButton.setMargin( margin );
|
||||
panel.add( htmlButton, new GridBagConstraints( 0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0,
|
||||
GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets( 4, 4, 24, 4 ), 0, 0 ) );
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
flatlaf.releaseVersion = 3.2.1
|
||||
flatlaf.releaseVersion = 3.2.2
|
||||
flatlaf.developmentVersion = 3.3-SNAPSHOT
|
||||
|
||||
org.gradle.parallel = true
|
||||
|
||||
@@ -24,7 +24,7 @@ junit = "5.7.2"
|
||||
sigtest = "org.netbeans.tools:sigtest-maven-plugin:1.7"
|
||||
|
||||
# flatlaf-extras
|
||||
jsvg = "com.github.weisj:jsvg:1.1.0"
|
||||
jsvg = "com.github.weisj:jsvg:1.2.0"
|
||||
|
||||
# flatlaf-jide-oss
|
||||
jide-oss = "com.formdev:jide-oss:3.7.12"
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
17
gradlew
vendored
17
gradlew
vendored
@@ -83,7 +83,8 @@ done
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
@@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@@ -201,11 +202,11 @@ fi
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
|
||||
Reference in New Issue
Block a user