JToggleButton BasicArrowButton JPanel.setBorder()

JToggleButton

 普通JButton鼠标点击释放后恢复原状,而JToggleButton鼠标点击释放后不恢复原状,再次点击时才恢复原状。

BasicArrowButton:

在javax.swing.plaf.basic中,上面有箭头的按钮。

public BasicArrowButton(int direction,
                Color background,
                Color shadow,
                Color darkShadow,
                Color highlight)
direction - the direction of the arrow; one of SwingConstants.NORTH, SwingConstants.SOUTH, 
		SwingConstants.EAST or SwingConstants.WEST	
background - the background color of the button
shadow - the color of the shadow
darkShadow - the color of the dark shadow
highlight - the color of the highlight




JPanel.setBorder() :Although technically you can set the border on any object that inherits from JComponent, the look and feel implementation of many standard Swing components doesn't work well with user-set borders. In general, when you want to set a border on a standard Swing component other than JPanel or JLabel, we recommend that you put the component in JPanel and set the border on the JPanel(建议把组件放在JPanel上,然后设置JPanel的边框)设置面板边框,参数可以为以下边框类型:

BevelBorder
A class which implements a simple two-line bevel border.
CompoundBorder
A composite Border class used to compose two Border objects into a single border by nesting an inside Border object within the insets of an outside Border object.
EmptyBorder
A class which provides an empty, transparent border which takes up space but does no drawing.
EtchedBorder
A class which implements a simple etched border which can either be etched-in or etched-out.
LineBorder
A class which implements a line border of arbitrary thickness and of a single color.
MatteBorder
A class which provides a matte-like border of either a solid color or a tiled icon.
SoftBevelBorder
A class which implements a raised or lowered bevel with softened corners.
StrokeBorder
A class which implements a border of an arbitrary stroke.
TitledBorder
A class which implements an arbitrary border with the addition of a String title in a specified position and justification.



你可能感兴趣的:(String,object,swing,Class,border,Components)