Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: help with java pragram  (Read 2954 times)

0 Members and 1 Guest are viewing this topic.

window_xp_ownes

    Topic Starter


    Starter

    help with java pragram
    « on: April 20, 2010, 09:52:21 PM »
    i am using eclipse to make my java program and it is showing me some errors. i try to fix them but it still shows errors.

    Code: [Select]
    package window;

    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public  class testModems extends JFrame {
    // makes buttons
        JButton cablebutton = new JButton("Cable");
        cablebutton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
        CableModem roadRunner = new CableModem();
        roadRunner.speed = 4000;
        System.out.println("Trying the cable modem");
        roadRunner.displaySpeed();
        roadRunner.connect();
        }
        });
       
    JButton DSLbutton = new JButton("DSL");
    DSLbutton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    DSLModem bellSouth = new DSLModem();
    System.out.println("Trying the DSL modem");
    bellSouth.displaySpeed();
    bellSouth.connect();
    }
    });

    JButton Wireless = new JButton("Wireless");
    Wireless.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    wireless waves = new wireless();
    System.out.println("Trying to connect to wireless connection");
    waves.displaySpeed();
    waves.connect();
    }
    });

    public testModems() {
    super("Modems");
    setSize(100, 200);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    FlowLayout lay = new FlowLayout();
    setLayout(lay);
    add(cablebutton);
    add(DSLbutton);
    add(Wireless);
    setVisible(true);
    }
    }

    Big



      Beginner

      Thanked: 4
      • Experience: Experienced
      • OS: Windows XP
      Re: help with java pragram
      « Reply #1 on: April 21, 2010, 10:38:38 AM »
      Would you mind telling us the errors.. :P

      Where are all your other classes?
      « Last Edit: April 21, 2010, 10:51:01 AM by Big »
      Computerhope is corrupt.

      window_xp_ownes

        Topic Starter


        Starter

        Re: help with java pragram
        « Reply #2 on: April 22, 2010, 05:35:22 PM »
        never mind i found out what i did wrong