Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By JosAH

Thread: help with my code please?

  1. #1
    MW130 is offline Senior Member
    Join Date
    Jan 2013
    Posts
    317
    Rep Power
    2

    Default help with my code please?

    hi i am having problem for line 8 it keeps saying that error cannot find symbol: BasicWindowMonitor, pointing to the B.
    Java Code:
    import java.awt.*;
    import java.awt.event.*;
    public class ToolbarFrame1 extends Frame implements ActionListener{
    Button cutButton, copyButton, pasteButton;
    public ToolbarFrame1() {
    super("Toolbar example");
    setSize(2880, 1920);
    addWindowListener(new BasicWindowMonitor());
    Panel toolbar = new Panel();
    toolbar.setLayout(new FlowLayout(FlowLayout.LEFT));
    cutButton = new Button("Cut!");
    cutButton.addActionListener(this);
    toolbar.add(cutButton);
    pasteButton  = new Button("Paste!");
    pasteButton.addActionListener(this);
    toolbar.add(pasteButton);
    copyButton = new Button ("Copy!");
    copyButton.addActionListener(this);
    toolbar.add(copyButton);
    add(toolbar,BorderLayout.NORTH);
    }
    public void actionPerformed(ActionEvent ae){
    System.out.println(ae.getActionCommand());
    }
    public static void main(String[] args){
    ToolbarFrame1 tf1 = new ToolbarFrame1();
    tf1.setVisible(true);
    }
    }

    what should I do?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,184
    Rep Power
    19

    Default Re: help with my code please?

    Quote Originally Posted by MW130 View Post
    help with my code please?
    Please go through the Forum Rules, particularly the third paragraph.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,375
    Blog Entries
    7
    Rep Power
    20

    Default Re: help with my code please?

    Quote Originally Posted by MW130 View Post
    what should I do?
    Properly indent your code; this blob is unreadable.

    kind regards,

    Jos
    Last edited by JosAH; 01-03-2013 at 12:00 PM. Reason: silly typo; I can't type ...
    DarrylBurke likes this.
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    926
    Rep Power
    2

    Default Re: help with my code please?

    The compiler complains: cannot find symbol BasicWindowMonitor. That means it can, well, erm, not find BasicWindowMonitor. Does the class exist? Did you import the class?

Similar Threads

  1. Replies: 16
    Last Post: 01-31-2012, 08:36 PM
  2. Replies: 3
    Last Post: 08-10-2011, 09:17 AM
  3. Replies: 0
    Last Post: 08-07-2011, 08:32 PM
  4. Replies: 0
    Last Post: 02-21-2011, 11:50 AM
  5. Replies: 1
    Last Post: 04-26-2007, 03:52 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •