Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想要一个看起来像这样的文本字段:
文本域 。文本域 。文本域。文本域
并在文本字段中输入数字。你能帮我吗?:)
您不需要父文本字段来充当 4 个文本字段的容器。在面板内放置 4 个文本字段。
在 java swing 中实现这一点的步骤: 1.创建JPanel一个白色背景。 2.添加 4 s,由valueJTextField分隔(使用 GridLayout 将它们保持在一行中)。3.禁用s 及其边框 的突出显示 或使文本字段透明4.当任何s 接受输入时 添加边框。JLabel.JTextFieldJPanelJTextfield
JPanel
JTextField
JLabel
.
JTextfield