Open georgesakiki opened 9 years ago
i have another error in : carSeller cs = new carSeller(ProductionYear,Windows,AC,Engine); jLabel1.setText(Integer.toString(cs.getPrice()));
please commit and synch
it's in last commit about 3 hours ago
Replace: this.setWindowsRelativeTo(this); With: this.setLocationRelativeTo(this);
When you call a constructor you have to respect 2 things: 1- Parameters must be of the same type (for example you are using production year as integer in JFrame and string in class and that's wrong....) 2- You must call the constructor with the same order of parameters (if the constructor takes (int a, String b) you must call it using (int c, String d) where c refers to a and d refers to d).
Also you are not declaring an instance of the class. You are declaring a new instance of the JFrame! CarSeller1 is your class so you must use: CarSeller1 cs = new CarSeller1(constructor parameters);
okey thank you
when i have windows , they was electrical or manual button so i want to press into one of them not the 2 in the same time.. what i have to do??
you add a radio group form the palette to the form and you connect the radio buttons to it from their proprieties.
It looks like the method carSeller is missing a return type. In Java, all methods must have a return type specified, unless they are constructors. In that case, the name of the method should match the name of the class and have no return type.
Here's how the carSeller method should be written:
public class CarSeller { public CarSeller() { initComponents(); this.setWindowsRelativeTo(this); manualButton.setSelected(true); rootPane.setDefaultButton(SUBMITBUT); this.setTitle("Car Seller"); } }
Note that the method has no return type and the class name is CarSeller (with an uppercase "C") to match the method name.
what's the error in : public carSeller() { initComponents(); this.setWindowsRelativeTo(this); manualButton.setSelected(true); rootPane.setDefaultButton(SUBMITBUT); this.setTitle("Car Seller"); }