Code:
import javax.swing.JDialog;
import javax.swing.JTextArea;
import javax.swing.JFrame;
public class AboutDialog
{
JFrame frame;
public AboutDialog(JFrame frame)
{
this.frame = frame;
String text = "Neki text";
JDialog dialog = new JDialog (frame, "About");
JTextArea area = new JTextArea(10,10);
area.append(text);
JDialog.add(area);
}
}
import javax.swing.JDialog;
import javax.swing.JTextArea;
import javax.swing.JFrame;
public class AboutDialog
{
JFrame frame;
public AboutDialog(JFrame frame)
{
this.frame = frame;
String text = "Neki text";
JDialog dialog = new JDialog (frame, "About");
JTextArea area = new JTextArea(10,10);
area.append(text);
JDialog.add(area);
}
}
greska koju BlueJ prijavljuje je "non-static method add(java.awt.Component) cannot be referenced from a a static context" sto ja uopste ne razumijem jer uopste nisam stavljao static.
p.s. i u glavnom class-u ovog projekta je ista stvar: kad napravim method createAboutDialog() javlja istu gresku a method nije static...
[Ovu poruku je menjao SpeedFreak dana 01.04.2006. u 15:07 GMT+1]
[Ovu poruku je menjao SpeedFreak dana 01.04.2006. u 15:08 GMT+1]
There are 10 types of people: those who understand binary and those who have
friends...
friends...