Are you sure you have problem? I have tried to test on my netbean and I do not see any problem. The button is shown in my computer
On Sep 16, 9:31 am, javaquestion <cplusplusquest...@gmail.com> wrote: > The "Add" button doesn't show in my computer, however, this code work > on some other computer. > > import java.awt.*; > import javax.swing.*; > > public class AddButton extends JFrame { > > public AddButton() { > setSize(300, 150); > setDefaultCloseOperation(EXIT_ON_CLOSE); > > JButton b = new JButton("Add"); > > Container c = getContentPane(); > c.setLayout(new FlowLayout()); > c.add(b); > repaint(); > } > > public static void main(String[] args) { > AddButton re = new AddButton(); > re.setVisible(true); > } > > } > > If I delete "setSize(300, 150);", add "pack()", it works. But I need > to set exactly size for this component. What's wrong with this? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Java EE (J2EE) Programming with Passion!" group. To post to this group, send email to java-ee-j2ee-programming-with-passion@googlegroups.com To unsubscribe from this group, send email to java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en -~----------~----~----~----~------~----~------~--~---