title: GUI of Stack using Java
body: <p>I am making a GUI of Stack using Java. Here is my code</p>
  
  <pre><code>     private void StackActionPerformed(java.awt.event.ActionEvent evt) 
      {
  
        b1=new JButton("Push");
        b2=new JButton("Pop");
        b3=new JButton("Peek");
        b4=new JButton("Clear");
        b1.addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
              pushButtonActionPerformed(evt);
          }
        });
        tb.add(b1);
        tb.add(b2);
        tb.add(b3);
        tb.add(b4);
        frame_st.add(tb);
        frame_st.setExtendedState(Frame.MAXIMIZED_BOTH);
  
    }
  </code></pre>
  
  <p>Here I am adding buttons to my toolBar (tb) everything is working fine . I am not getting any error. But after compiling am not getting the desired result . toolBar(tb) is not able to add the buttons (b1,b2,etc)</p>