Results 1 to 5 of 5
  1. #1

    Default need help making THESAURUS..


    mau ni amung codes mga bro pde pa help unsaon pra ang output kay ang synonyms sa g search na word.. g.exteralize ni nmu.


    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;


    public class ThesActions implements ActionListener{

    private Thesaurus t;

    public ThesActions(Thesaurus thes){
    this.t= thes;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
    // TODO Auto-generated method stub

    String[][] A= new String[1][];

    //search button
    int a = 0;
    if(e.getSource()==t.searchb){
    //t.text.getText();
    t.area.setText("");

    for(int l=0; l<5; l++){
    if(t.text.getText().equals(Messages.getString("A"+ a+"_"+l))){ //$NON-NLS-1$ //$NON-NLS-2$

    for(int m=0;m<2;m++){
    A[0]= new String[9];
    }

    for(int x=0; x<2; x++){
    for(int y=0;y<10;y++){
    A[0][x]=(Messages.getString("A"+a+"_"+y)); //$NON-NLS-1$ //$NON-NLS-2$
    }
    }

    for(int x=0; x<1; x++){
    for(int y=0;y<10;y++){
    t.area.setText(t.area.getText() + Messages.getString("A"+a+"_"+y)); //$NON-NLS-1$ //$NON-NLS-2$
    }
    }
    }else{
    a++;
    }
    }
    }
    }
    }


    import javax.swing.JButton;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import java.awt.BorderLayout;
    import java.awt.FlowLayout;

    public class Thesaurus {

    JFrame frame;
    JTextField text;
    JButton searchb, addb, delb;
    JTextArea area;
    JComboBox sort;
    ThesActions actions;


    public Thesaurus(){
    //JFrame.setDefaultLookAndFeelDecorated(true);
    this.frame = new JFrame("Thesaurus"); //$NON-NLS-1$
    this.text = new JTextField();
    this.area = new JTextArea();
    this.searchb = new JButton("Search"); //$NON-NLS-1$
    this.delb = new JButton("Delete"); //$NON-NLS-1$
    this.addb = new JButton("Add"); //$NON-NLS-1$
    String[] SortOptions = { "Ascending", "Descending" }; //$NON-NLS-1$ //$NON-NLS-2$
    this.sort = new JComboBox(SortOptions);

    actions = new ThesActions(this);
    }

    public void launchGUI(){

    this.frame.setSize(500,525);
    // this.frame.setResizable(false);
    this.frame.setLayout(new BorderLayout());
    this.frame.setVisible(true);

    /* added line */
    this.frame.setDefaultCloseOperation(JFrame.EXIT_ON _CLOSE);


    JPanel p = new JPanel();
    p.setLayout(new FlowLayout());
    this.text.setColumns(26);
    p.add(this.text);
    p.add(this.searchb);

    searchb.addActionListener(this.actions);

    JPanel p1 = new JPanel();
    p1.setLayout(new FlowLayout());
    p1.add(this.addb);
    p1.add(this.delb);
    p1.add(this.sort);

    addb.addActionListener(this.actions);
    delb.addActionListener(this.actions);
    sort.addActionListener(this.actions);

    JPanel pa = new JPanel();
    this.area.setColumns(40);
    this.area.setRows(25);
    this.area.insert("\n\n\n\n\n\n\n\n\n\n\t\tTHESAURU S", 0); //$NON-NLS-1$
    this.area.setEditable(false);
    this.area.setLineWrap(true);
    pa.add(this.area);


    this.frame.add(p, BorderLayout.NORTH);
    this.frame.add(pa, BorderLayout.CENTER);
    this.frame.add(p1, BorderLayout.SOUTH);
    }
    }

    (from message.properties)

    A0_0=affliction
    A0_1=abyss
    A0_2=agony
    A0_3=anguish
    A0_4=blazes
    A0_5=bottomless
    A0_6=difficult
    A0_7=hell
    A0_8=perdition
    A0_9=purgatory

    A1_0=accept
    A1_1=acknowledge
    A1_2=abear
    A1_3=concede
    A1_4=consent
    A1_5=defer
    A1_6=endure
    A1_7=hang in
    A1_8=live with
    A1_9=put up with

  2. #2

    Default Re: need help making THESAURUS..

    Unsa ni nga code - working ba ni?

  3. #3

    Default Re: need help making THESAURUS..

    uu working na.. eclipse ang ggamit na app sa pag code.

  4. #4

    Default Re: need help making THESAURUS..

    Make sure you have a database. And each row of your database bear all necessary synonyms from A to Z. Suppose the searched word is "word". Search the database from the existence of the word "word" in your synonyms row. Display all the synonyms.

  5. #5

    Default Re: need help making THESAURUS..

    i'm not basing from ur code, but for the algorithm. one need to have word or term relationships para sakto imong pag relate sa word synonyms. otherwise it would be faulty logic.

  6.    Advertisement

Similar Threads

 
  1. need help: how to make steam rice?
    By yolskai in forum Food & Dining
    Replies: 5
    Last Post: 07-04-2010, 05:39 AM
  2. Replies: 12
    Last Post: 11-18-2009, 01:49 PM
  3. Need Help making db & UI with MS Access ONLY
    By yarniwre in forum Programming
    Replies: 1
    Last Post: 10-20-2009, 12:24 PM
  4. Site making need help
    By handsoff241 in forum Programming
    Replies: 5
    Last Post: 04-11-2009, 01:01 AM
  5. C/C++ i need help in making a program
    By mE_bytes in forum Programming
    Replies: 54
    Last Post: 07-30-2008, 05:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top