如何修改JComboBox的宽度
代码:
String[] arr={"http://itts.ihe.ufo.com/rtts/ws.jsp","http://ittsstg.ihe.ufo.com/rtts/ws.jsp"}; urlCbo=new JComboBox(arr); urlCbo.setEditable(true); urlCbo.setFont(new Font("Arial",Font.PLAIN,16)); urlCbo.setSize(new Dimension(800, 40)); urlCbo.setPreferredSize(new Dimension(800, 30));// 这里就是设置JComboBox宽度的代码
效果示例: