本文整理汇总了Java中org.jdesktop.swingx.border.DropShadowBorder类的典型用法代码示例。如果您正苦于以下问题:Java DropShadowBorder类的具体用法?Java DropShadowBorder怎么用?Java DropShadowBorder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DropShadowBorder类属于org.jdesktop.swingx.border包,在下文中一共展示了DropShadowBorder类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FancyButton
import org.jdesktop.swingx.border.DropShadowBorder; //导入依赖的package包/类
/**
* Creates a button with initial text and an icon.
*
* @param text
* the text of the button
* @param icon
* the Icon image to display on the button
*/
public FancyButton(String text, Icon icon) {
super(text, icon);
// setup fancy button things
addMouseListener(hoverListener);
addFocusListener(focusListener);
setBorderPainted(false);
setBorder(new DropShadowBorder(SHADOW_COLOR, 5, 0.5f, 12, false, false, true, true));
setFocusPainted(false);
setContentAreaFilled(false);
setHorizontalAlignment(SwingConstants.LEFT);
setHorizontalTextPosition(SwingConstants.RIGHT);
setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
setForeground(normalTextColor);
drawArrow = true;
}
示例2: interactiveFancyButton
import org.jdesktop.swingx.border.DropShadowBorder; //导入依赖的package包/类
public void interactiveFancyButton() {
JXButton button = new JXButton("Dummy .... but lonnnnnnngg");
button.setBorder(BorderFactory.createCompoundBorder(new DropShadowBorder(), button.getBorder()));
JXPanel panel = new JXPanel();
panel.add(button);
showInFrame(panel, "Fancy..");
}
示例3: createRendererComponent
import org.jdesktop.swingx.border.DropShadowBorder; //导入依赖的package包/类
@Override
protected AbstractButton createRendererComponent() {
JXButton button = new JXButton();
border = BorderFactory.createCompoundBorder(
new DropShadowBorder(),
button.getBorder());
return button;
}
示例4: ComponentPreviewPanel
import org.jdesktop.swingx.border.DropShadowBorder; //导入依赖的package包/类
private ComponentPreviewPanel(Orientation orientation) {
this.orientation = orientation;
setBorder(new DropShadowBorder(Color.GRAY, 2, 0.7f, 2, false, false, true, true));
}
示例5: FancyDropDownButton
import org.jdesktop.swingx.border.DropShadowBorder; //导入依赖的package包/类
public FancyDropDownButton(Action mainAction, Action arrowAction, boolean showText) {
super(mainAction);
if (!showText) {
mainButton.setText(null);
}
mainButton.setOpaque(false);
arrowButton.setOpaque(false);
mainButton.setBorderPainted(false);
mainButton.setMargin(new Insets(0, 0, 0, 0));
mainButton.getModel().addChangeListener(changeListener);
arrowButton.getModel().addChangeListener(changeListener);
if (arrowAction != null) {
arrowButton.addActionListener(arrowAction);
} else {
arrowButton.addActionListener(new DefaultArrowAction());
}
arrowButton.setMargin(new Insets(0, 0, 0, 0));
mainButton.addPropertyChangeListener("enabled", new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
arrowButton.setEnabled(mainButton.isEnabled());
}
});
arrowButtonPanel.setLayout(new CardLayout());
arrowButtonPanel.setFloatable(false);
arrowButtonPanel.setBorder(null);
arrowButton.setBorderPainted(true);
emptyPanel.setOpaque(false);
arrowButtonPanel.setOpaque(false);
// setup fancy button things
addMouseListener(hoverListener);
addArrowButtonMouseListener(hoverListener);
addFocusListener(focusListener);
setBorderPainted(false);
setBorder(new DropShadowBorder(SHADOW_COLOR, 5, 0.5f, 12, false, false, true, true));
arrowButton.setBorder(new DropShadowBorder(SHADOW_COLOR, 5, 0.5f, 12, false, false, true, true));
setFocusPainted(false);
setContentAreaFilled(false);
setHorizontalAlignment(SwingConstants.LEFT);
setHorizontalTextPosition(SwingConstants.RIGHT);
setForeground(NORMAL_TEXTCOLOR);
setFont(new Font("Open Sans Light", Font.PLAIN, 28));
setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
arrowButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}
示例6: FancyDropDownButton
import org.jdesktop.swingx.border.DropShadowBorder; //导入依赖的package包/类
public FancyDropDownButton(Action mainAction, Action arrowAction, boolean showText) {
super(mainAction);
if (!showText) {
mainButton.setText(null);
}
mainButton.setOpaque(false);
arrowButton.setOpaque(false);
mainButton.setBorderPainted(false);
mainButton.setMargin(new Insets(0, 0, 0, 0));
mainButton.getModel().addChangeListener(changeListener);
arrowButton.getModel().addChangeListener(changeListener);
if (arrowAction != null) {
arrowButton.addActionListener(arrowAction);
} else {
arrowButton.addActionListener(new DefaultArrowAction());
}
arrowButton.setMargin(new Insets(0, 0, 0, 0));
mainButton.addPropertyChangeListener("enabled", new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
arrowButton.setEnabled(mainButton.isEnabled());
}
});
arrowButtonPanel.setLayout(new CardLayout());
arrowButtonPanel.setFloatable(false);
arrowButtonPanel.setBorder(null);
arrowButton.setBorderPainted(true);
emptyPanel.setOpaque(false);
arrowButtonPanel.setOpaque(false);
// setup fancy button things
addMouseListener(hoverListener);
addArrowButtonMouseListener(hoverListener);
addFocusListener(focusListener);
setBorderPainted(false);
setBorder(new DropShadowBorder(SHADOW_COLOR, 5, 0.5f, 12, false, false, true, true));
arrowButton.setBorder(new DropShadowBorder(SHADOW_COLOR, 5, 0.5f, 12, false, false, true, true));
setFocusPainted(false);
setContentAreaFilled(false);
setHorizontalAlignment(SwingConstants.LEFT);
setHorizontalTextPosition(SwingConstants.RIGHT);
setForeground(NORMAL_TEXTCOLOR);
setFont(FontTools.getFont("Open Sans Light", Font.PLAIN, 28));
setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
arrowButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}