Reading specific lines in a file

Hard to explain the problem, but ill try my best. Basically i want the program to read lines 1-6 of a text file, then read lines 7-12, then 13-18. but right now its not.

My output is this:

First run

Second run

Ignore the number in the top left, that was just so i could test my lock in button.

I have no idea what to do. Any help will be greatly appreciated.

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.*;
import java.util.*;

public class Game extends JFrame
{
JLabel lblQuestion;
JRadioButton btA;
JRadioButton btB;
JRadioButton btC;
JRadioButton btD;
JButton btLock;
JTextField txtQuestion;
int question = 0;

public Game()
{
    getContentPane().setLayout(null);
    setupGUI();
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}  

.

    btLock.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            btLock.setEnabled(false);
            btLock.setText("Lock In");
            txtQuestion.setText(Integer.toString(question));
            try{
                String[] array = questions();
                lblQuestion.setText("<html>"+array[0]+"</html>");
                btA.setText(array[1]);
                btB.setText(array[2]);
                btC.setText(array[3]);
                btD.setText(array[4]);
            }catch(Exception ex){}



            question++;
        }
    });

    setTitle("Who wants to be a millionare");
    setSize(570,400);
    setVisible(true);
    setResizable(false);
    setLocationRelativeTo(null);


}

public String[] questions() throws IOException{
    File file = new File("questions.txt");
    if (!file.exists()){
        throw new FileNotFoundException("Could not find \"users\" file");
    }
    FileReader fr = new FileReader(file.getAbsoluteFile());
    BufferedReader br = new BufferedReader(fr);

    String[] array = new String[6];

    //I wanted this to skip the lines i dont need but i didnt work
    for(int i = 0; (i*5) < question; i++){
        br.readLine();
    }

    for(int i = 0; i < 5; i++){
        array[i] = br.readLine();
    }

    br.close();
    return array;   
}

public static void main( String args[] )
{
    new Game();
}
}  

Answers


Im an idiot

for(int i = 0; i < question; i++){
        br.readLine();
        br.readLine();
        br.readLine();
        br.readLine();
        br.readLine();
        br.readLine();
    }

    for(int i = 0; i < 6; i++){
        array[i] = br.readLine();
    }

Done


Need Your Help

Text appears that's not in code

c# forms text richtextbox windows-forms-designer

I'm making a game. In this game there is a lot of dialogue. So, the text property of my richTextBox1 is constantly changing. At first I had it set to say "What should I do?" and "Now what?" but I t...

What should be the name of sitemap file while submitting to Google Webmasters?

sitemap google-webmaster-tools

I just want to know while submitting a sitemap file to Google webmasters, what should be the name of the file?