-
Help with JOptionPane
Hi guys!
Just wanted to know if anyone could help me.
I want to make a program (when used, the user gets 3 words, from a line, randomly from this location:
Code:
public static void main(String[] args)
{
File file = new File("C:\\weapons.txt");
try {
ive made a set of JOptionPane boxes that ticks up, so the user must write in "Weapons.txt" to gain access and so on. What i need help with, is how i can get further with my "String input 4":
I want the JOptionPane input window to show 3 types of weapons, (3 weapons from one line). Witch line is the line that shows in the JOptionPane box, thats randomly.
Example of lines in the .TXT:
AK47 AG3 MP5
AWP SIGS65 RWP8
etc etc etc
etc etc etc
etc etc etc
My window:
Code:
String input4 = JOptionPane.showInputDialog (null, input3, "Input", JOptionPane.QUESTION_MESSAGE);
So from here on, im stuck. How can i get my print from the .TXT file, in to the JOptionPane string (input 4), on a line?
If anyone understands what im talking about that is :)
-
i can mention that im making a quick test for my buddies in the weapon club :) so the program will eventually print out a score and so on. Correct answers, etc. :)