6 Posted Topics
Re: I'm guessing you have a class named "Math" in the same directory, and it is using that instead of java.lang.Math. | |
Re: Click "Build" / "Run Arguments" in jGRASP to make the arguments entry field visible. | |
Re: [QUOTE=javaAddict;1155683]Also you must add a ';' at the end of the declaration and initialize it. Otherwise you will get a NullPointerException.[/QUOTE] "name" is definitely assigned before any use. Unless the code is changed so that is no longer true, it's better to use the declaration without initialization. | |
Re: You should never do anything in Swing outside the event dispatching thread, except those few methods which are guaranteed to be thread safe (SwingUtilities.invokeLater(), etc.). Your code should look like: [code] public static void main(String[] args){ SwingUtilities.invokeLater( new Runnable() { public void run() { new TabelaEShahut(); } } ); } … | |
Re: [code]RepaintManager.currentManager(your_component).setDoubleBufferingEnabled(false);[/code] What you are doing is OK for a quick demo, but it doesn't really make sense. paintComponent() should paint the current state of the component, not produce animation. Depending on how you construct this, you may also get two or more queued paint events at startup, so the painting … | |
Re: There were some changes to how the executable links work in recent versions of Cygwin. The latest version of jGRASP should handle those, so you probably need to [URL="http://www.jgrasp.org"]upgrade[/URL]. Then you won't need a custom compiler environment as your instructor suggests, just go back to the default. Also, make sure … |
The End.