I have a normal content pane in Java (IDE: Eclipse) and a JTextField.
Now I want the text field to always be on the far right, even if the size of the window changes. Is this somehow possible?
I have a normal content pane in Java (IDE: Eclipse) and a JTextField.
Now I want the text field to always be on the far right, even if the size of the window changes. Is this somehow possible?
One way to is nest panels with different layout manager.
The default layout manager of the content pane of the frame is a BorderLayout (unless Eclipse changes it, in which case you should set it back to a BorderLayout.
Then you can:
JPanelwith aFlowLayoutthat is right aligned.BorderLayout.PAGE_STARTof the content pane.BorderLayout.CENTER.