This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hello all, I've seen many examples that invoked pack() method but the others didn't and only invoked setVisible(true). I don't understand that when the pack() is invoked, can anyone tell me? Thank you.
pack is used when you are using layout managers and you want the JFrame to be the smallest size showing all components. If you set the size of your JFrame manually ( setSize(), setBounds() ) then you don't need to call pack().