jpedro20 2 Posted December 8, 2012 Report Share Posted December 8, 2012 Boa tarde, Tenho o seguinte código que foi gerado pelo window builder pro no eclipse: import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JButton; public class Client extends JFrame { /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { Client frame = new Client(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the frame. */ public Client() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 610, 433); getContentPane().setLayout(null); JButton btnNewButton = new JButton("New button"); btnNewButton.setBounds(0, 0, 117, 411); getContentPane().add(btnNewButton); } } O problema é que sempre que não defino um layout e executo o programa, os componentes (neste caso um simples botão) aparecem com um certo delay em relação à frame. Se definir um layout isto já não acontece. Alguém sabe porque isto acontece e métodos para resolver? Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now