问题描述
看了好多例子。但是没有解决。自己这块用的很少。。求指点怎么实现下图效果。最好有代码。。 问题补充:<div class="quote_title">yqin 写道</div><div class="quote_div"><pre name="code" class="java">Panel panel=new Panel();JLabel label1=new JLabel("修改"); JLabel label2=new JLabel("删除");JLabel label3=new JLabel("预约");JLabel label4=new JLabel("挂号");panel.add(label1);panel.add(label2);panel.add(label3);panel.add(label4); Object [][]data={ { {"2010-8-8","咨询",((JLabel)panel.getComponent(0)).getText()+" "+((JLabel)panel.getComponent(1)).getText()+" "+((JLabel)panel.getComponent(2)).getText()+" "+((JLabel)panel.getComponent(3)).getText()}, {"2010-8-8","咨询",((JLabel)panel.getComponent(0)).getText()+" "+((JLabel)panel.getComponent(1)).getText()+" "+((JLabel)panel.getComponent(2)).getText()+" "+((JLabel)panel.getComponent(3)).getText()} };</pre></div><br /><br /><br /><br /><br /><br />。。。这个label能响应事件吗。。<br />需求改了。不放到table中了。多谢解答<br />
解决方案
Panel panel=new Panel();JLabel label1=new JLabel("修改"); JLabel label2=new JLabel("删除");JLabel label3=new JLabel("预约");JLabel label4=new JLabel("挂号");panel.add(label1);panel.add(label2);panel.add(label3);panel.add(label4); Object [][]data={ { {"2010-8-8","咨询",((JLabel)panel.getComponent(0)).getText()+" "+((JLabel)panel.getComponent(1)).getText()+" "+((JLabel)panel.getComponent(2)).getText()+" "+((JLabel)panel.getComponent(3)).getText()}, {"2010-8-8","咨询",((JLabel)panel.getComponent(0)).getText()+" "+((JLabel)panel.getComponent(1)).getText()+" "+((JLabel)panel.getComponent(2)).getText()+" "+((JLabel)panel.getComponent(3)).getText()} };