Jump to content

[Swing] Absolute Layout delay


Recommended Posts

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();
			} catch (Exception e) {

* Create the frame.
public Client() {
	setBounds(100, 100, 610, 433);

   JButton btnNewButton = new JButton("New button");
   btnNewButton.setBounds(0, 0, 117, 411);


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 comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.