我想使我的JTextfield
不可见和只读,但该值必须显示在窗口框架中。我在Eclipse中使用窗口生成器。如何使JTextField(Eclipse窗口生成器)只读
JLabel lblLabel1 = new JLabel("Default DITA-OT File :");
lblLabel1.setBounds(10, 79, 123, 14);
frmPdfPublisher.getContentPane().add(lblLabel1);
JSeparator separator = new JSeparator();
separator.setBounds(10, 140, 414, 2);
frmPdfPublisher.getContentPane().add(separator);
JSeparator separator_1 = new JSeparator();
separator_1.setBounds(10, 257, 414, 2);
frmPdfPublisher.getContentPane().add(separator_1);
textField_1 = new JTextField();
textField_1.setBounds(138, 76, 286, 20);
frmPdfPublisher.getContentPane().add(textField_1);
textField_1.setColumns(10);
textField_1.setVisible(false);
尝试在该[线程]该溶液(http://stackoverflow.com/questions/3081713/how删除边框要么 - 设置文本框不可见 - 框架内) –
@DataPro我可以设置可见和不可见。但是会显示任何价值?值显示可见。例如: - 就像我们在右键单击 - >属性 - >文件位置中看到的一样。 ? –
1)为了更好地提供帮助,请发布[MCVE]或[简短,独立,正确的示例](http://www.sscce.org/)。 2)Java GUI必须在不同的语言环境中使用不同的PLAF来处理不同的操作系统,屏幕大小,屏幕分辨率等。因此,它们不利于像素的完美布局。请使用布局管理器或[它们的组合](http://stackoverflow.com/a/5630271/418556)以及[white space]的布局填充和边框(http://stackoverflow.com/a/17874718/ 418556)。 ..“ –