|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Member
Iscritto dal: Mar 2007
Città: roma
Messaggi: 115
|
[java] colore
import javax.swing.JFrame;
import javax.swing.JOptionPane; class graf { public static void main(String args[]) { String input=JOptionPane.showInputDialog("ecco il mio primo inserimento"); //int choice=Integer.parseInt(input); //Shapes panel = new Shapes(choice); JFrame application=new JFrame(); //crea il frame principale application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //chiude il frame application.setSize(300,300); // attributi dell'istanza "application" application.setVisible(true); application.setTitle(input); application.setLocation(300,300); } } Vorrei dare un colore allo sfondo del Frame.....come posso fare? |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Oct 2007
Città: Padova
Messaggi: 4131
|
Ciao,
se consulti i Javadoc puoi vedere come JFrame erediti dalla classe Component: Codice:
java.lang.Object extended by java.awt.Component extended by java.awt.Container extended by java.awt.Window extended by java.awt.Frame extended by javax.swing.JFrame
__________________
As long as you are basically literate in programming, you should be able to express any logical relationship you understand. If you don’t understand a logical relationship, you can use the attempt to program it as a means to learn about it. (Chris Crawford) |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 10:48.