您的位置:首页 > 移动开发 > Objective-C

JToggleButton BasicArrowButton JPanel.setBorder()

2011-11-16 22:00 190 查看


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 a 
JPanel
 and set the border on the 
JPanel(
建议把组件放在JPanel上,然后设置JPanel的边框)。设置面板边框,参数可以为以下边框类型:

BevelBorderA class which implements a simple two-line bevel border.
CompoundBorderA 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.
EmptyBorderA class which provides an empty, transparent border which takes up space but does no drawing.
EtchedBorderA class which implements a simple etched border which can either be etched-in or etched-out.
LineBorderA class which implements a line border of arbitrary thickness and of a single color.
MatteBorderA class which provides a matte-like border of either a solid color or a tiled icon.
SoftBevelBorderA class which implements a raised or lowered bevel with softened corners.
StrokeBorderA class which implements a border of an arbitrary stroke.
TitledBorderA class which implements an arbitrary border with the addition of a String title in a specified position and justification.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息