Pequenas Duvidas -

1 resposta
J

Galera, sou totalmente cabacim em Java, e gostaria de tirar algumas duvidas.

Como mudar a cor de um JText???
Como Abrir minha janela no centro da tela???
Como fazer um menu semelhante ao Windows Explorer???

Tenho até vergonha destas duvidas, pois a acho muito basica, mas, se algum fio di Deus, pude mi ajuda, agradeço…

:???:

Jarrão.

1 Resposta

R

e ai blz…

ai vai algumas dicas…

// 1
JTextField() txtNome = new JTextField();
				
this.getContentPane().add(txtNome);
				
txtNome.setBounds(361, 150, 300, 20);
				
txtNome.setPreferredSize(new java.awt.Dimension(29, 16));
				
txtNome.setForeground(new java.awt.Color(61, 108, 156));
				
txtNome.setFont(new java.awt.Font("Arial",1,14));
				
txtNome.setSize(300, 20);


// 2
{
	this.setSize(320, 252);
	Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
	int largura = this.getSize().width;
	int altura = this.getSize().height;
	int metadeLargura = (screen.width - largura) / 2;
	int metadeAltura = (screen.height - altura) / 2;
	this.setLocation(metadeLargura, metadeAltura);
	setResizable(false);
}

// 3

http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html

este tem vários exemplos…
http://java.sun.com/docs/books/tutorial/uiswing/TOC.html#components

falou…

Criado 8 de julho de 2005
Ultima resposta 8 de jul. de 2005
Respostas 1
Participantes 2