首页 新闻 赞助 找找看

Java 卡片布局的显示问题

0
悬赏园豆:50 [待解决问题]

定义好一个jpanel的卡片布局,也将卡片添加到jpanel里面,怎么在监听器里面调用相应的卡片。

jpanelSorthright.setBackground(Color.ORANGE); //jpanelSorthright相关设置
jpanelSorthright.setPreferredSize(new Dimension(600,400));
jpanelSorthright.setLayout(new CardLayout());

    cardinsert card_insert = new cardinsert();           //生成的是jpanel,自定义jpanel
    carddelete card_delete = new carddelete();
    cardupdate1 card_update = new cardupdate1();
    cardselect1 card_select = new cardselect1();
  

    jpanelSorthright.add(card_insert.jpanel_one(),"insert");
    jpanelSorthright.add(card_delete.jPanel_two(),"delete");
    jpanelSorthright.add(card_update.jPanel_three(),"update");
    jpanelSorthright.add(card_select.jPanel_four(),"selete");

    button_insert.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            
        }
    });
    button_delete.addActionListener();
    button_update.addActionListener();
    button_select.addActionListener();
A-Lun的主页 A-Lun | 初学一级 | 园豆:152
提问于:2019-12-23 20:22
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册