0

I have seen many JavaScript applications of this being done on the internet and would like to create on designed on Java.

As I am new to this, I have no clue on what to do. I have a fair idea and so far I have this:

package dice_game;
import javax.swing.*;


public class Main {


public class Objects {
// declare the global variables
int wip0, wip1, wip2, wip3, wip4;
int dice0, dice1, dice2, dice3, dice4;
int pass0, pass1, pass2, pass3, pass4;


int diceroll, total;


}


public static void main(String[] args) {


int dice0 = (int)(Math.random()*6) + 1;
System.out.println("Your first score: " + dice0);



}


}

Any clues guys?

Edited by happygeek: fixed formatting

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by javaAddict
0

You cannot create a javascript application in java, because javascript is not java, it is javascript.
You create javascript applications written in javascript.
And the javasx.swing package is for desktop applications. It has nothing to do with the internet.

I suggest to forget what you want to do for a few years.
From the code you wrote you don't even know good java.

Clear your thoughts. Decide what you want to do specifically and read some books on that. From what I read, you don't even know what you want to do.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.