문제

I have 2 classes, and each one of them has a launcher for a form that utilizes them:

DateTester uses DateTest class and is launched by dateLauncher CylinderTest uses Cylinder class and is launched by cylLauncher

each launcher is simply comprised of

Cylinder program = new Cylinder();

respectively. They both launched fine by themselves. What I would like to do is create a launcher window (just a pane with two buttons) that will launch either program when their buttons is clicked. I just moved everything into the same package (although im thinking that I shouldnt have done that now), and now neither will launch from their respective launcher. I was trying to launch them with something like:

public void actionPerformed(ActionEvent ev)
{
     if(ev.getSource() == btnCylinder)
     {
          Cylinder prgCylinder = new Cylinder();
     }
     else if (ev.getSource() == btnDate)
     {
          DateTester prgDate = new DateTester();
     }
     else{}
}

but it doesnt do anything. I also tried threading them, and that didnt work either. Any suggestions? Or is this actually a lot more complicated than it seems?

도움이 되었습니까?

해결책

turns out it was just the action listener not added for the buttons. paulo answered this in a comment, but i need to close this as answered. thanks paulo.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top