That's right, I have a JTabbedPane that has a JPanel that contains JLabel and JTextField.
my code
JTabbed Pane Announcement:
this.tabPane = new JTabbedPane(); this.tabPane.setSize(750, 50); this.tabPane.setLocation(10, 10); tabPane.setSize(750,450); tabPane.add("ControlPanel",controlPanel);
text field declaration:
this.channelTxtFld = new JTextField(""); this.channelTxtFld.setFont(this.indentedFont); this.channelTxtFld.setSize(200, 30); this.channelTxtFld.setLocation(200, 10);
JLabel: this.channelLabel = new JLabel ("Channel name:"); this.channelLabel.setSize (150, 30); this.channelLabel.setLocation (10,10);
private void createPanels() { controlPanel = new JPanel(); controlPanel.setSize(650,500); } private void fillPanels() { controlPanel.add(channelLabel); controlPanel.add(channelTxtFld); }
So my plan is to have a tabbed panel in which there is a JPanel where I have some shortcuts, text fields and buttons at fixed positions, but after that this is my result:
http://i.stack.imgur.com/vXa68.png
What I wanted was that I had JLabel, and next to it appeared a full JTextfield on the left side, and not in the middle.
Does anyone know what my mistake is?
Thank you:)
java swing jbutton jlabel jtextfield
Lucas Kauffman Apr 24 '11 at 23:18 2011-04-24 23:18
source share