Note that there are some explanatory texts on larger screens.

plurals
  1. POset size wont work in java
    text
    copied!<pre><code>public void start_Gui() { JFrame window = new JFrame("Client Program"); window.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE); JPanel panel = new JPanel(); window.setContentPane(panel); panel.setLayout(new GridLayout(1,2)); JLabel leftside = new JLabel(); leftside.setLayout(new GridLayout(2, 1)); JTextArea rightside = new JTextArea(); rightside.setEditable(false); //add scroll pane. rightside.setBorder(BorderFactory.createLineBorder(Color.BLACK)); rightside.setLayout(new FlowLayout()); JTextArea client_text_input = new JTextArea(); client_text_input.setBorder(BorderFactory.createLineBorder(Color.BLACK)); leftside.add(client_text_input); JLabel buttons_layer = new JLabel(); JButton login = new JButton("Login"); JButton logout = new JButton("Logout"); buttons_layer.setBorder(BorderFactory.createLineBorder(Color.BLACK)); buttons_layer.setLayout(new GridLayout(2, 1)); buttons_layer.add(login); buttons_layer.add(logout); leftside.add(buttons_layer); panel.add(leftside); panel.add(rightside); window.setSize(300, 400); window.setResizable(false); window.setVisible(true); } </code></pre> <p>I am working on a simple java chat client gui application. (the server etc, is done by others).</p> <p>It is not a big project, but my only problem is that whatever I do to try to resize any components on the above GUI, won't work.</p> <p>For example:</p> <pre><code>JTextArea client_text_input = new JTextArea(); client_text_input.setSize(100,200); </code></pre> <p>Won't work.</p> <p>Thanks for the help.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload