Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setBounds method not working?????

Status
Not open for further replies.

compris

Technical User
Nov 27, 2001
1
CA
I'm trying to get my homework done but I cannot get the setbounds method to work. Can anyone see why?

package richmond9package;

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

public class richmond9applet extends Applet
{

Label coffeeBrandLblObj = new Label("Coffee Brand");
Label coffeeFlavourLblObj = new Label("Coffee Flavour");
Label coffeeColourLblObj = new Label("Coffee Colour");
Label coffeeCaffeineLblObj = new Label("Caffeine");
Label coffeeCostLblObj = new Label("Cost/Lb");
Label coffeePoundsLblObj = new Label("Pounds");

TextField coffeeBrandTextFieldObj = new TextField(15);
TextField coffeeFlavourTextFieldObj = new TextField(15);
TextField coffeeColourTextFieldObj = new TextField(15);
TextField coffeeCaffeineTextFieldObj = new TextField(15);
TextField coffeeCostTextFieldObj = new TextField(15);
TextField coffeePoundsTextFieldObj = new TextField(15);

Button buttonObj = new Button("Enter Order");

TextArea orderTextAreaObj = new TextArea(15,25);



public void init()
{
coffeeBrandLblObj.setBounds(1,1,12,22);
coffeeFlavourLblObj.setBounds(1,3,22,31);
add(coffeeBrandLblObj);
add(coffeeFlavourLblObj);
add(coffeeColourLblObj);
add(coffeeCaffeineLblObj);
add(coffeeCostLblObj);
add(coffeePoundsLblObj);

add(coffeeBrandTextFieldObj);
add(coffeeFlavourTextFieldObj);
add(coffeeColourTextFieldObj);
add(coffeeCaffeineTextFieldObj);
add(coffeeCostTextFieldObj);
add(coffeePoundsTextFieldObj);

add(buttonObj);

add(orderTextAreaObj);

}

}
 
hi compr
to what contentpane are u trying to set bounds for ????????
hope u got what i am telling u u should specify panel or frame on which u can set and add them to
if u need any more help u can post it
bye
techg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top