File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes how to align it??urgent.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how to align it??urgent.." Watch "how to align it??urgent.." New topic

how to align it??urgent..

kahkean chor
Ranch Hand

Joined: Jan 26, 2013
Posts: 56
can someone help me to solve this problem? i dont want this 2 panel to be balance(the jtextarea and jtextfield should be longer,don't wan it to be balance same as the jlist and jbutton).....but except gridlayout i gt no idea to set it .

this is my code,

JPanel jp1 = new JPanel();
JPanel jp2 = new JPanel();

JLabel jblInfo = new JLabel("User Name :");

String[] members = {"Raymond","Alex","Kelvin"};
JList listMember = new JList(members);
JTextArea lobby = new JTextArea();

JTextField input = new JTextField();
JButton send = new JButton("Send");

public void init() {

jp1.setLayout(new GridLayout(1,2,5,5));

jp2.setLayout(new GridLayout(1,2,5,5));



[Thumbnail for fail.jpg]

Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
no idea how you want it to look, but this is a different way of doing it

kahkean chor
Ranch Hand

Joined: Jan 26, 2013
Posts: 56
thanks for your look nice but i hope to enhance it abit

How to increase the height of jlist and how to make the jbutton to the bottom(parallel with jtextfield)

[Thumbnail for Untitled.jpg]

Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
don't use the holdingPanel.
add jp2 directly to the frame/applet
at BorderLayout.EAST
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 38107
Our vocabulary does not include the word “urgent”.
It is sorta covered in the JavaRanch Style Guide.
subject: how to align it??urgent..
Similar Threads
JTextField not accessable in applet
JTextField with arrow listener(up&down).
JTextArea refresh problem
Problem with GroupLayout Manager
jframe not accepting sql query..