read file randomly and output in the label
<p>I use these codes for reading in a text file randomly and show me the output in label . I don't know how I read random word or line and out put in the label?
finaly my aim is reading random word and out put that word in the label </p>

<pre><code>static JLabel lbl;
JLabel word ;

a(){    
    ButtonComponent ();
    OtherParts ();
    labels();       

    setTitle("HangmanGame");
    setSize(840, 310);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    setLayout(null);
    setVisible(true);
    setLocation(320, 150);
}

public void labels(){
    for(int s=19; s&gt;=8;s--){
        word = new JLabel ("");
        word.setBounds( s*30, 60, 20, 20);
        add(word);              
    }

    for (int a = 19; a &gt;= 8; a--) {
        JLabel lbl = new JLabel("_");
        lbl.setBounds(a * 30, 60, 20, 20);
        add(lbl);
    }
}

public void OtherParts () {
    JTextField tf = new JTextField();
    tf.setBounds(55, 190, 340, 30);
    add(tf);

    JButton Guess = new JButton("Guess");
    Guess.setBounds(410, 190, 355, 30);
    add(Guess);
    JLabel chance = new JLabel ("Remaining Chance");
    chance.setBounds(55, 215, 340, 30);
    add(chance);

}

public void ButtonComponent () {
    for (int i = 65; i &lt; 78; i++) {
        JButton temp = new JButton("" + (char) i);
        temp.addActionListener(new BtnListener());
        temp.setBounds((i - 64) * 55, 110, 50, 30);
        add(temp);
    }
    for (int i = 78; i &lt; 91; i++) {
        JButton temp = new JButton("" + (char) i);
        temp.addActionListener(new BtnListener());
        temp.setBounds((i - 77) * 55, 150, 50, 30);
        add(temp);
    }
}

public void MenuComponent () {
    JMenuBar menubar = new JMenuBar();
    setJMenuBar(menubar);

    JMenu file = new JMenu("File");
    menubar.add(file);
    JMenuItem newgame = new JMenuItem("New");
    JMenuItem savegame = new JMenuItem("Save Game");
    JMenuItem Loadgame = new JMenuItem("Load");
    JMenuItem exit = new JMenuItem("Exit");

    file.add(savegame);
    file.add(Loadgame);
    file.add(exit);
    file.add(newgame);

    exit.addActionListener(new exitListener());
    JMenu option = new JMenu("Option");
    menubar.add(option);
    JMenuItem op = new JMenuItem("Option");
    option.add(op);
}

class exitListener implements ActionListener {
    public void actionPerformed(ActionEvent arg0) {
        System.exit(0);
    } 
}

class BtnListener implements ActionListener {
    public void actionPerformed(ActionEvent e) {    
        JButton clickedButton = (JButton) e.getSource();
        String text = clickedButton.getText();
        System.out.println(text + lbl);     
        //word.setText(text);
    }
}

public static void main(String[] args) {
    new a();
    Properties readfile = new Properties();
    try {
        readfile.load(new FileInputStream("ciu"));
    } catch (Exception e) {
        System.out.println(e.toString());
    }
    for (int i = 1; i &lt;5; i++) {
        String line = readfile.getProperty("" + i);
        System.out.println(line);
    }
}
</code></pre>
