Ciao a tutti,ho da poco installato linux ed eclipse,e fin qui tutto ok.
ho fatto delle prove di programmi java con un editor ed ho lanciato l'applicazione ed anche qui tutto ok,quando vado a scrivere le stesse cose su eclipse mi esce questo errore
queste sono le semplici prove che facevo,aprire un frame e di default metterlo a tutto schermo:
codice:
import java.awt.*;
import javax.swing.*;
public class Frame {
// costruttore
public Frame() {
super();
this.setTitle("prova");
// this.steLocaton(300,300); //si aspetta due int
// toolkit per interrogare la scheda grafica per sapere i pixel
Toolkit tk = Toolkit.getDefaultToolkit();
// abbiamo tre classi molto utili point(con due cassetti int x e y) e
// dimension(heigth,width) e rectangle(tutti e 4 i cassatte)
Dimension dim = tk.getScreenSize();
System.out.println(dim);
this.setSize(dim.width / 2, dim.height / 2);
this.setLocation(dim.width / 4, dim.height / 4);
this.setVisible(true);
this.setExtendedState(JFrame.MAXIMIZED_BOTH);// MAXIMIDE_BOTH//E DOPO
// SET VISIBLE
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// OPPURE: EXIT_ON_CLOSE,HIDE_ON_CLOSE, DISPOSE_ON_CLOSE,distrugge
// this.setResizable(false);//non la fa modificare
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
new Frame();
}
}
e questo è l'errore che mi da eclipse(con l'altro editor funziona tutto)
codice:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The method setTitle(String) is undefined for the type Frame
The method setSize(int, int) is undefined for the type Frame
The method setLocation(int, int) is undefined for the type Frame
The method setVisible(boolean) is undefined for the type Frame
The method setExtendedState(int) is undefined for the type Frame
The method setDefaultCloseOperation(int) is undefined for the type Frame
at Frame.<init>(Frame.java:8)
at Frame.main(Frame.java:31)
mi sapete spiegare da cosa deriva? siccome non conosco affatto eclipse non lo capisco.
mille grazie...