|
|
|
@ -1,10 +1,8 @@
|
|
|
|
|
package com.fr.design.gui.ibutton; |
|
|
|
|
|
|
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
|
|
|
|
|
import javax.swing.Icon; |
|
|
|
|
import javax.swing.JFrame; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.JPopupMenu; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
@ -18,6 +16,14 @@ import static com.fine.theme.utils.FineClientProperties.STYLE_PRIMARY;
|
|
|
|
|
import static com.fine.theme.utils.FineClientProperties.setStyle; |
|
|
|
|
import static com.formdev.flatlaf.FlatClientProperties.BUTTON_TYPE; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 双按钮组件 |
|
|
|
|
* |
|
|
|
|
* @author vito |
|
|
|
|
* @since 11.0 |
|
|
|
|
* <p> |
|
|
|
|
* created by vito on 2023/12/28 |
|
|
|
|
**/ |
|
|
|
|
public class UICombinationButton extends JPanel { |
|
|
|
|
private static final String UI_CLASS_ID = "CombinationButtonUI"; |
|
|
|
|
|
|
|
|
@ -146,18 +152,4 @@ public class UICombinationButton extends JPanel {
|
|
|
|
|
protected void showPopWindow(JPopupMenu menu) { |
|
|
|
|
GUICoreUtils.showPopupMenu(menu, this, 0, getY() + getHeight() - 3); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void main(String... args) { |
|
|
|
|
JFrame jf = new JFrame("test"); |
|
|
|
|
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
|
|
|
JPanel content = (JPanel) jf.getContentPane(); |
|
|
|
|
content.setLayout(null); |
|
|
|
|
|
|
|
|
|
UICombinationButton bb = new UICombinationButton("123455", UIConstants.ARROW_DOWN_ICON); |
|
|
|
|
bb.setBounds(20, 20, bb.getPreferredSize().width, bb.getPreferredSize().height); |
|
|
|
|
content.add(bb); |
|
|
|
|
GUICoreUtils.centerWindow(jf); |
|
|
|
|
jf.setSize(400, 400); |
|
|
|
|
jf.setVisible(true); |
|
|
|
|
} |
|
|
|
|
} |