Results 1 to 2 of 2
  1. #1
    sanctishit is offline Member
    Join Date
    Mar 2010
    Posts
    2
    Rep Power
    0

    Default 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:

    Java 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:
    Java 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 :)

  2. #2
    sanctishit is offline Member
    Join Date
    Mar 2010
    Posts
    2
    Rep Power
    0

    Default

    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. :)

Similar Threads

  1. need help with a JOptionPane
    By dr4g0nk1ng in forum Advanced Java
    Replies: 2
    Last Post: 02-19-2010, 09:40 PM
  2. need help for JOptionPane....
    By keycoffee in forum New To Java
    Replies: 1
    Last Post: 02-09-2010, 08:59 AM
  3. JOptionpane
    By tommyyyy in forum New To Java
    Replies: 2
    Last Post: 03-20-2009, 08:33 AM
  4. JOptionPane
    By Mir in forum New To Java
    Replies: 5
    Last Post: 11-29-2008, 02:04 AM
  5. JOptionPane
    By whosadork in forum New To Java
    Replies: 2
    Last Post: 10-23-2008, 02:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •