jlabel 不能连续两次set_关于JLabel的setText在监听器中不刷新有关问题(2)

当前位置:我的异常网» J2SE » 关于JLabel的setText在监听器中不刷新有关问题

关于JLabel的setText在监听器中不刷新有关问题(2)

www.myexceptions.net  网友分享于:2013-12-17  浏览:253次

jpPosition.setBorder(new TitledBorder("Position"));

// Place title justification radio buttons

JPanel jpJustification = new JPanel();

jpJustification.setLayout(new GridLayout(3,1));

jpJustification.add(jrbLeft = new JRadioButton("LEFT"));

jpJustification.add(jrbCenter = new JRadioButton("CENTER"));

jpJustification.add(jrbRight = new JRadioButton("RIGHT"));

jpJustification.setBorder(new TitledBorder("Justification"));

// Creat panel jpTitleOptions to how jpPosition and jpJustification

JPanel jpTitleOptions = new JPanel();

jpTitleOptions.setLayout(new BorderLayout());

jpTitleOptions.add(jpPosition,BorderLayout.CENTER);

jpTitleOptions.add(jpJustification,BorderLayout.EAST);

// Create Panel jpTitle to hold a check box and title position radio

// buttons, and title justification radio buttons

JPanel jpTitle = new JPanel();

jpTitle.setBorder(new TitledBorder("Border Title"));

jpTitle.setLayout(new BorderLayout());

jpTitle.add(jchkTitled = new JCheckBox("Titled"),BorderLayout.NORTH);

jpTitle.add(jpTitleOptions , BorderLayout.CENTER);

// Group radio buttons for title position

ButtonGroup btgTitlePosition = new ButtonGroup();

btgTitlePosition.add(jrbAboveBottom);

btgTitlePosition.add(jrbAboveTop);

btgTitlePosition.add(jrbBottom);

btgTitlePosition.add(jrbTop);

btgTitlePosition.add(jrbBelowBottom);

btgTitlePosition.add(jrbBelowTop);

// Group radio buttons for title justification

ButtonGroup btgTitleJustification = new ButtonGroup();

btgTitleJustification.add(jrbLeft);

btgTitleJustification.add(jrbCenter);

btgTitleJustification.add(jrbRight);

//22222222222222222222222222222

// Create Panel jpBorderStyle to hold border style radio buttons

JPanel jpBorderStyle = new JPanel();

jpBorderStyle.setBorder(new TitledBorder("Border Style"));

jpBorderStyle.setLayout(new GridLayout(6,1));

jpBorderStyle.add(jrbLoweredBevel = new JRadioButton("Lowered Bevel"));

jpBorderStyle.add(jrbRaisedBevel = new JRadioButton("Raised Bevel"));

jpBorderStyle.add(jrbEtched = new JRadioButton("Etched"));

jpBorderStyle.add(jrbLine = new JRadioButton("Line"));

jpBorderStyle.add(jrbMatte = new JRadioButton("Matte"));

jpBorderStyle.add(jrbEmpty = new JRadioButton("Empty"));

//Group radio buttons for border styles

ButtonGroup btgBorderStyle = new ButtonGroup();

btgBorderStyle.add(jrbLoweredBevel);

btgBorderStyle.add(jrbRaisedBevel);

btgBorderStyle.add(jrbEtched);

btgBorderStyle.add(jrbLine);

btgBorderStyle.add(jrbMatte);

btgBorderStyle.add(jrbEmpty);

// Create Panel jpAllChoices to place jpTitle and jpBorderStyle

JPanel jpAllChoies = new JPanel();

jpAllChoies.setLayout(new BorderLayout());

jpAllChoies.add(jpTitle , "Center");

jpAllChoies.add(jpBorderStyle, "East");

// Place panels in the frame

setLayout(new BorderLayout());

add(jLabel1,"Center");

add(jpAllChoies,"South");

文章评论

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值