JToggleButton问题

shaot399 2007-03-16 03:18:40
这个控件,我一点,然后就下去不在上来,再一点,它才再弹起来,我想在程序代码中,让它弹起来,咋办
...全文
213 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
terranhao 2007-03-22
  • 打赏
  • 举报
回复
为什么不直接用JButton
点下之后将 JButton.setEnable(false);
想让他可以使用的时候再setEnable(true);
不过弹出效果就没了
shaot399 2007-03-21
  • 打赏
  • 举报
回复
呵呵,楼上的,先谢过顶

jbutton点过直接就起来了,而我想要的效果是,鼠标点过下去之后,我完成一定的逻辑之后呢,通过程序让它弹起来。呵呵
eagerEagle 2007-03-18
  • 打赏
  • 举报
回复
你为什么要用它呢?
如果你想的是点一下就上来,直接用JButton啊
shaot399 2007-03-16
  • 打赏
  • 举报
回复
pup
shaot399 2007-03-16
  • 打赏
  • 举报
回复
pu
shaot399 2007-03-16
  • 打赏
  • 举报
回复
up
ublic class JCalendar extends JPanel{ //动态表示年月日 private int year=0; private int month=0; private int day=0; private int first = 0; //用于标志日历面板是否显示 private static boolean isShow = false; //主面板 private JPanel Main = new JPanel(); //日面板 private JPanel jPanelDay = new JPanel(); //月面板 private JPanel jPanelMonth = new JPanel(); //月的输入位置 private JTextField Month = new JTextField(); //减少月份 private JButton MonthDown = new JButton(); //增加月份 private JButton MonthUp = new JButton(); private JPanel jPanelButton = new JPanel(); //减少年份 private JButton YearDown = new JButton(); //增加年份 private JButton YearUp = new JButton(); //显示日期的位置 private JLabel Out = new JLabel(); public JLabel Out2 = new JLabel(); private Locale l=Locale.CHINESE; //主日历 private GregorianCalendar cal=new GregorianCalendar(l); //星期面板 private JPanel weekPanel=new JPanel(); //天按钮组 private JToggleButton[] days=new JToggleButton[42]; //天面板 private JPanel Days = new JPanel(); //标示 private JLabel jLabel1 = new JLabel(); private JLabel jLabel2 = new JLabel(); private JLabel jLabel3 = new JLabel(); private JLabel jLabel4 = new JLabel(); private JLabel jLabel5 = new JLabel(); private JLabel jLabel6 = new JLabel(); private JLabel jLabel7 = new JLabel(); //当前选择的天数按钮 private JToggleButton cur=null; //月份天数数组,用来取得当月有多少天 // 1 2 3 4 5 6 7 8 9 10 11 12 private int[] mm={31,28,31,30,31,30,31,31,30,31,30,31}; //空日期构造函数 public JCalendar() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } //带日期设置的构造函数 public JCalendar(int year, int month, int day) { cal.set(year, month, day); try { jbInit(); } catch (Exception e) { e.printStackTrace(); }

62,612

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧