It says i need an identifier to put in the parentheses but i don't know what identifier.
import javax.swing.;
import java.awt.;
class Main
{
public static void main(String[] agrs)
{
JFrame window = new JFrame("Jason's Canvas"); //title name
window.setSize(800, 600);//set the sixe of the window
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//the methood window.setDefaultCloseOperation is specifcally for the constant Jframe.EXIT_ON_CLOSE to close the application
window.setVisible(true);//Function window.setVisible. A function available to window-based terminal objects created via the window API, which toggles the visibility flag
}
void drawRectangles(Graphics)
{
Graphics2D g2d = (Graphics2D) g;
g2d.drawRect(30, 50, 420, 120);
}
}
Could you put your code into a repl?
@Vandesm14 I thought thats what i did and if i didnt how do i do that.
@jascas03 Oops, I didn't see that you did until now. My bad!
You need to remove the extra .
's right before the ;
on lines 1 and 2
@Vandesm14 i know but it says in line 40 that the word public is an illegal expression.
@jascas03 Not sure past that. I will get someone who knows Java better on this for you!
@jascas03 On line 39 you have an extra {
@jascas03 Also consider avoiding creating inner classes, as far as I can tell inner classes(a class defined in a class) may not have static properties.
https://repl.it/@CSharpIsGud/JavaScript Here is a fixed version without any syntax errors, but it opens 2 windows one of them has a rectangle in it but it was hard to tell what in the world you were trying to do.
As my working version is almost entirely different from the original repl.