Browse Source
Merge in DESIGN/design from ~RENEKTON/design:newui to newui * commit 'c66aaa287cf8262f8af8590f65405b2449a50ddb': 按钮间距、布局、optionPaneUI设置确定button style;主题设置面板缩放 finelat文件 按钮间距、布局、optionPaneUI设置确定button style;主题设置面板缩放newui
Renekton-张世豪
3 months ago
34 changed files with 165 additions and 82 deletions
@ -0,0 +1,38 @@
|
||||
package com.fine.theme.light.ui; |
||||
|
||||
import com.fine.theme.utils.FineUIStyle; |
||||
import com.formdev.flatlaf.ui.FlatOptionPaneUI; |
||||
|
||||
import javax.swing.JButton; |
||||
import javax.swing.JComponent; |
||||
import javax.swing.UIManager; |
||||
import javax.swing.plaf.ComponentUI; |
||||
import java.awt.Component; |
||||
import java.awt.Container; |
||||
|
||||
/** |
||||
* @author Renekton |
||||
* @since 2024/08/15 |
||||
* Created on 2024/08/15 |
||||
*/ |
||||
public class FineOptionPaneUI extends FlatOptionPaneUI { |
||||
|
||||
/** |
||||
* 注册当前类的UI对象 |
||||
*/ |
||||
public static ComponentUI createUI(JComponent c ) { |
||||
return new FineOptionPaneUI(); |
||||
} |
||||
|
||||
@Override |
||||
protected void addButtonComponents(Container container, Object[] buttons, |
||||
int initialIndex) { |
||||
super.addButtonComponents(container, buttons, initialIndex); |
||||
Component[] components = container.getComponents(); |
||||
for (Component component: components) { |
||||
if (UIManager.getString("OptionPane.okButtonText", optionPane.getLocale()).equals(((JButton) component).getText())) { |
||||
FineUIStyle.setStyle((JButton) component, FineUIStyle.STYLE_PRIMARY); |
||||
} |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue