JToggleButton BasicArrowButton JPanel.setBorder()
2011-11-16 22:00
190 查看
普通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
JPanelor
JLabel, we
recommend that you put the component in a
JPaneland 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. |
相关文章推荐
- AndroidGUI04:Button(Basic Button,ImageButton, Check Box, Toggle Button, Radio Button)的常用技巧
- 细谈SetButtonInfo函数及其用途
- The method setPositiveButton(int, DialogInterface.OnClickListener) in the type AlertDialog.Builder is not applicable for the arguments
- RadioGroup中的RadioButton rb.setChecked(false)后重新选中无法选中——陈科肇
- 14. 8. 2. JToggleButton is a button that has two states. Pressed and not pressed.
- How to set up a basic working Appium test environment
- 关于android创建对话框报错The method setPositiveButton(int, DialogInterface.OnClickListener) in the type Alert
- button.setOnClickListener出错
- Android开发 ActionBar中setDisplayHomeAsUpEnabled和setHomeButtonEnabled的理解
- 对android中ActionBar中setDisplayHomeAsUpEnabled和setHomeButtonEnabled和setDisplayShowHomeEnabled方法的理解
- UIBarButtonItem的setTitleTextAttributes方法不起作用
- UIBarButtomItem:The set of possible titles to display on the bar button.
- ccah-500 第13题Which three basic configuration parameters must you set to migrate
- Uploadify 插件 “Call to SetButtonDisabled failed” 错误解决方法
- Using Single Alert For Messages And Confirmation Messages In Oracle Forms With Set_Alert_Button_Property
- clearButton.setOnClickListener(this);
- UCGUI中如何使用BUTTON_SetBMPEx()函数在按钮中添加图片问题
- 在Fragment中进行button setonclicklistener的问题