7 Replies - 1345 Views - Last Post: 07 October 2010 - 09:01 AM Rate Topic: -----

#1 cris_carriaga  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 05-October 10

help java using array

Posted 07 October 2010 - 01:28 AM

hi someone help me to have a code

this is my project
using array

Posted Image

this the format of the applet window

Posted Image

example if you input abbreviation
then click search the result is the State

here is my code

import java.applet.*;
import java.awt.*;
import java.awt.event.*;
 

public class finals extends Applet implements ActionListener
 {
     Label lblState = new Label ("STATE FINDER");
     
     Label lblSelect = new Label ("Select Keyword");
     CheckboxGroup cbgSize = new CheckboxGroup();
     Checkbox optAbbreviation  = new Checkbox("Abbreviation",cbgSize, false);
     Checkbox optName = new Checkbox("State name",cbgSize, true);
     Button btnSearch = new Button ("SEARCH");
     Label lblResult =  new Label ("Result");
     TextField txtAbbreviation = new TextField (5);
     TextField txtName = new TextField (5);
     TextField txtResult = new TextField (5);

  
    public void init() 
    {
       setBackground(Color.green);
       add(lblState);
       add(optAbbreviation);
       add(optName);
       add(lblSelect);
       add(btnSearch);    btnSearch.addActionListener(this);
       add(txtResult);    txtResult.requestFocus();
       add(lblResult);   
       add(txtName);
       add(txtAbbreviation);
    
   
   
      }
      public void actionPerformed(ActionEvent a)
      {
        
      }
   }




thanks

This post has been edited by cris_carriaga: 07 October 2010 - 04:03 AM


Is This A Good Question/Topic? 0
  • +

Replies To: help java using array

#2 Brewer  Icon User is offline

  • Awesome
  • member icon

Reputation: 179
  • View blog
  • Posts: 1,044
  • Joined: 14-June 10

Re: help java using array

Posted 07 October 2010 - 02:39 AM

If you want help then you have to tell us what you think is wrong with it. What errors do you get, if any, when you run the program? Are you asking us to help you create the program or fix the program?
Was This Post Helpful? 0
  • +
  • -

#3 cris_carriaga  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 05-October 10

Re: help java using array

Posted 07 October 2010 - 03:30 AM

the code is some what missing

i dont know what should i put

using array
Was This Post Helpful? 0
  • +
  • -

#4 Dogstopper  Icon User is online

  • The Ninjaducky
  • member icon



Reputation: 2876
  • View blog
  • Posts: 11,051
  • Joined: 15-July 08

Re: help java using array

Posted 07 October 2010 - 03:54 AM

...edit: Oh, you have code... put it between the code tags. :code:

Give yourself some time to sit down and look at what type of things repeat, or have in common. Those things are perfect for arrays! Look at the series of letters. If you must use arrays, sure, do that, but this will be much better with a Map.

If you want to make an array, make an array of State objects. Each state object has a full name and an abbreviation. Make it work...

This post has been edited by Dogstopper: 07 October 2010 - 03:56 AM

Was This Post Helpful? 0
  • +
  • -

#5 cris_carriaga  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 05-October 10

Re: help java using array

Posted 07 October 2010 - 04:06 AM

thanks

the code is my design only

Quote

If you want to make an array, make an array of State objects. Each state object has a full name and an abbreviation. Make it work...


how can i do that?

can you show me a code example thanks.

This post has been edited by cris_carriaga: 07 October 2010 - 04:07 AM

Was This Post Helpful? 0
  • +
  • -

#6 cris_carriaga  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 05-October 10

Re: help java using array

Posted 07 October 2010 - 04:13 AM

please help me

this is our final test

thanks a lot
Was This Post Helpful? 0
  • +
  • -

#7 Dogstopper  Icon User is online

  • The Ninjaducky
  • member icon



Reputation: 2876
  • View blog
  • Posts: 11,051
  • Joined: 15-July 08

Re: help java using array

Posted 07 October 2010 - 08:52 AM

Stop bumping your topics! We will get to your question when we can. Bumping is nothing except rude.

Thank you.

And I just told you, we won't write your code for you. Sorry. Listen to my post and try to implement it. Then, if you have problems, we will help you further.
Was This Post Helpful? 0
  • +
  • -

#8 Brewer  Icon User is offline

  • Awesome
  • member icon

Reputation: 179
  • View blog
  • Posts: 1,044
  • Joined: 14-June 10

Re: help java using array

Posted 07 October 2010 - 09:01 AM

I will give you one better than Dogstopper, who pretty much told you what to do. Click here, it's a link to the Sun tutorial on Arrays. You can figure it out yourself from here. Try Googling before you post, the Internet is the largest library in the world.
Was This Post Helpful? -3
  • +
  • -

Page 1 of 1