JIDE: fixed JidePopup border

This commit is contained in:
Karl Tauber
2019-11-20 17:01:23 +01:00
parent 645be4bfa3
commit b129fe437c
5 changed files with 75 additions and 3 deletions

View File

@@ -18,12 +18,14 @@ package com.formdev.flatlaf.testing.jideoss;
import static com.formdev.flatlaf.FlatClientProperties.TABBED_PANE_HAS_FULL_BORDER;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import com.formdev.flatlaf.testing.*;
import com.formdev.flatlaf.testing.FlatTestFrame;
import com.jgoodies.forms.layout.*;
import com.jidesoft.plaf.LookAndFeelFactory;
import com.jidesoft.popup.JidePopup;
import com.jidesoft.swing.*;
import net.miginfocom.swing.*;
@@ -88,6 +90,20 @@ public class FlatJideOssTest
}
}
private void showJidePopupButtonActionPerformed( ActionEvent e ) {
Component invoker = (Component) e.getSource();
JPanel panel = new JPanel( new MigLayout() );
panel.add( new JLabel( "Name:") );
panel.add( new JTextField( 20 ) );
JidePopup popupMenu = new JidePopup();
popupMenu.add( panel );
popupMenu.setDetached( true );
popupMenu.setOwner( invoker );
popupMenu.showPopup();
}
private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
JPanel panel9 = new JPanel();
@@ -116,6 +132,9 @@ public class FlatJideOssTest
moreTabsCheckBox = new JCheckBox();
tabScrollCheckBox = new JCheckBox();
hasFullBorderCheckBox = new JCheckBox();
JPanel panel10 = new JPanel();
JLabel jidePopupLabel = new JLabel();
JButton showJidePopupButton = new JButton();
CellConstraints cc = new CellConstraints();
//======== this ========
@@ -131,7 +150,7 @@ public class FlatJideOssTest
panel9.setOpaque(false);
panel9.setLayout(new FormLayout(
"70dlu:grow, $lcgap, 70dlu:grow",
"pref, 2*($lgap, fill:70dlu:grow), $lgap, pref"));
"pref, 2*($lgap, fill:70dlu:grow), $lgap, pref, $lgap, default"));
//---- tabbedPaneLabel ----
tabbedPaneLabel.setText("JideTabbedPane:");
@@ -277,6 +296,27 @@ public class FlatJideOssTest
panel14.add(hasFullBorderCheckBox, "cell 2 0,alignx left,growx 0");
}
panel9.add(panel14, cc.xywh(1, 7, 3, 1));
//======== panel10 ========
{
panel10.setLayout(new MigLayout(
"insets 3 0 3 3,hidemode 3",
// columns
"[fill]" +
"[fill]",
// rows
"[]"));
//---- jidePopupLabel ----
jidePopupLabel.setText("JidePopup:");
panel10.add(jidePopupLabel, "cell 0 0");
//---- showJidePopupButton ----
showJidePopupButton.setText("show JidePopup");
showJidePopupButton.addActionListener(e -> showJidePopupButtonActionPerformed(e));
panel10.add(showJidePopupButton, "cell 1 0");
}
panel9.add(panel10, cc.xy(1, 9));
}
add(panel9, "cell 0 0");
// JFormDesigner - End of component initialization //GEN-END:initComponents

View File

@@ -14,7 +14,7 @@ new FormModel {
name: "this"
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class com.jgoodies.forms.layout.FormLayout ) {
"$columnSpecs": "70dlu:grow, labelcompgap, 70dlu:grow"
"$rowSpecs": "pref, linegap, fill:70dlu:grow, linegap, fill:70dlu:grow, linegap, pref"
"$rowSpecs": "pref, linegap, fill:70dlu:grow, linegap, fill:70dlu:grow, linegap, pref, linegap, default"
} ) {
name: "panel9"
"opaque": false
@@ -192,6 +192,28 @@ new FormModel {
"gridY": 7
"gridWidth": 3
} )
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "insets 3 0 3 3,hidemode 3"
"$columnConstraints": "[fill][fill]"
"$rowConstraints": "[]"
} ) {
name: "panel10"
add( new FormComponent( "javax.swing.JLabel" ) {
name: "jidePopupLabel"
"text": "JidePopup:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 0"
} )
add( new FormComponent( "javax.swing.JButton" ) {
name: "showJidePopupButton"
"text": "show JidePopup"
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showJidePopupButtonActionPerformed", true ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 0"
} )
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) {
"gridY": 9
} )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 0"
} )