hello!

m new to java.i want to create an application that accepts length x width from combo box.there are 100 values.i want to draw a rectangle whose size will change for each value in a combo box depending on its length and width.
which method should i use?
can any one help me?

Thanx in advance...

hello!

m new to java.i want to create an application that accepts length x width from combo box.there are 100 values.i want to draw a rectangle whose size will change for each value in a combo box depending on its length and width.
which method should i use?
can any one help me?

Thanx in advance...

which method should i use?

Impossible to say without further information.

There are several parts to this task:

  • Setting up the GUI with a Combo Box and a panel to draw the rectangle on.
  • Putting the values into the combo box.
  • Having the program extract the length/width string from the combo box when the user selects the size.
  • Parsing the combo box selection into integers.
  • Drawing the rectangle with the right width/length.

So you need to decide what on that list you can and can't do. The methods to use depend on which part of the task you're referring to and how you have set things up.

Thanx for rply.

values in combo box are 4.8 x 2.4 , 4.8 x 2.3,..,4.7 x 2.3,..,01 x 01.and so on.
do i need to write code for each combo box item? or is it possible to write only 1 condition?

This article has been dead for over six months. Start a new discussion instead.