Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ul> <li><p><code>JLabel n = new JLabel()</code>; isn't visible because used <code>GroupLayout</code> required bunch of code for <code>vertical</code> and <code>horizontal</code> coordinates in <code>JPanel</code></p></li> <li><p><code>JLabel n = new JLabel();</code> missing these coordinates used for <code>jLabel1 = new javax.swing.JLabel();</code> into <code>private void initComponents() {</code> then <code>JLabel n = new JLabel();</code> couldn't be visible in <code>JPanel</code>, and you can to see only <code>jLabel1</code></p></li> <li><p>remove code block <code>private void initComponents() {</code> and to continue with hand coding for your GUI</p></li> <li><p><code>JPanel</code> has implemented <code>FlowLayout</code> in API</p></li> <li><p><code>JFrame</code> has implemented <code>BorderLayout</code> in API</p></li> </ul> <p><img src="https://i.stack.imgur.com/eRA5g.jpg" alt="enter image description here"></p> <pre><code>import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; public class JavaApplication1 { private JFrame frame = new JFrame(); private JPanel panel = new JPanel(); private JLabel label = new JLabel(); public JavaApplication1() { label.setText("asdasdasd"); panel.add(label); frame.add(panel); frame.pack(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } public static void main(String[] args) { javax.swing.SwingUtilities.invokeLater(new Runnable() { @Override public void run() { JavaApplication1 j1 = new JavaApplication1(); } }); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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