
November 4th, 2012, 12:56 PM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 2
Time spent in forums: 45 m 53 sec
Reputation Power: 0
|
|
|
Need some help please
Code:
if(main.equals("Start")) {
Object[] topics{"Random","Sports","Geography","Politics","History"};
String topic=(String)JOptionPane.showInputDialog(null,"Choose a topic:","Topics",JOptionPane.QUESTION_MESSAGE, null, topics,topics[1]);
new Thread(){
public void run() {
.main(new String[]{});}
}.start();
This is a part of a code for a quiz that I am doing, this is supposed to run an external file with the questions for each topic. The only little thing that i need to add here is the file name right before main.
Code:
.main(new String[]{});}
My question is; How do I make on of the objects in "topics" to register into the .main part?
For example:
I choose the Sports topic
that means I want
Code:
Sports.main(new String[]{});}
to be executed.
I still cannot figure this out, which I have been trying to do for the past 4 hours
Any help appreciated 
|