not exactly sure whee to go next
hi, im trying to write a quote generator which will take
in a author and a topic area and then returns a random quote
this is the code which i have done so far can anybody please put me in the right direction
import java.awt.*;
import java.util.*;
import java.applet.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.Graphics;
import java.awt.Color;
public class Assessement2 extends JApplet implements ActionListener{
JLabel Title,Photo;
JComboBox AuthorCombo,TopicCombo;
JButton QuoteButton;
JTextArea QuoteArea;//various variables that i needed to complete the program
ArrayList Author= new ArrayList();
public void init(){//this method is used to organise the interface
Container c =getContentPane();
c.setLayout(null);
Title=new JLabel("Quote Generator", JLabel.CENTER);
Title.setFont(new Font("Serif", Font.BOLD, 24));
Title.setForeground(Color.white);
Title.setBounds(0,5,350,30);
c.add(Title);
//Photo=new JLabel(candle.gif);
//private Image candle;
AuthorCombo=new JComboBox();
AuthorCombo.setBounds(10,50,150,25);
AuthorCombo.setForeground(Color.white);
AuthorCombo.addItem("Sanny McCsandwich");
AuthorCombo.addItem("Scott Sinclair");
c.add(AuthorCombo);
TopicCombo=new JComboBox();
TopicCombo.setBounds(190,50,150,25);
TopicCombo.setForeground(Color.white);
TopicCombo.addItem("Religious");
TopicCombo.addItem("Humour");
c.add(TopicCombo);
QuoteArea=new JTextArea();
QuoteArea.setBounds(10,85,260,170);
c.add(QuoteArea);
QuoteButton=new JButton("Press Here For Quote");
QuoteButton.setBounds(2,270,348,30);
QuoteButton.setForeground(Color.white);
c.add(QuoteButton);
QuoteButton.addActionListener(this);
}
public void actionPerformed (ActionEvent e){
if(e.getSource() ==QuoteButton){//adds the data to the java consol
SerachArray();
}
}
public void SerachArray();
{
String StrAuthor=(String)AuthorCombo.getSelectedItem();
String StrTopic=(String)TopicCombo.getSelectedItem();
}
/*boolean sentenceFound=false;
ArrayList searchString = new ArrayList();
searchString.add ("beefy");
searchString.add ("bing");
searchString.add ("frogs");
searchString.add ("assassination");
searchString.add ("blue");
boolean WordStore[] = new boolean[5];
WordStore[0] = false; //beefy
WordStore[1] = false; //bing
WordStore[2] = false; //frogs
WordStore[3] = false; //assassination
WordStore[4] = false; //blue
}*/
}
}
help would be much appreciated
|