build.addActionListener(this); prebuilt.addActionListener(this);
and I'm using
public void actionPerformed (ActionEvent event)
{
System.out.println("click");
if (event.getSource() == build)
{
System.out.println("build clicked");
}
if (event.getSource() == prebuilt)
{
System.out.println("Prebuilt clicked");
}
}
to differentiate between the two buttons but neither of them do what they are supposed to.
If I click either then it says "click" like its supposed to but its not telling which is which.
If you get what I mean?
Any help would be greatly appreciated.
Also, if I were to print event.getSource() out to screen should I be getting something as long as this...
javax.swing.JButton[,608,207,110x26,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@1034bb5,flags=296,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=Build my Bike,defaultCapable=true]
Thanks in advance


Sign In
Create Account

Back to top









