我想將單個標題邊框設置爲textfields組,我如何在java/swing中執行此操作。java中的邊框
我曾嘗試下面的代碼,但文本字段內板壓
// Create panel and add some components to it.
JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
pnl.add(new JLabel("Name"));
pnl.add(new JTextField());
// Add titled border to panel, which will therefore surround
// all child components placed on the panel.
pnl.setBorder(BorderFactory.createTitledBorder("It's Friday!"));
你能提供更多的上下文嗎?這是一個擺動應用程序? AWT? HTML? – Asaph 2010-01-15 07:10:13
請解釋這個「文本字段在面板內壓縮」的說法!你看到什麼,你會看到什麼發生? – 2010-01-15 07:58:13