Results 1 to 3 of 3

Thread: Help Please!!!

  1. #1
    Zakir is offline Member
    Join Date
    Oct 2011
    Posts
    1
    Rep Power
    0

    Question Help Please!!!

    package menubar;

    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JFrame;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;

    /**
    *
    * @author User
    */
    public class Menyu extends javax.swing.JPanel {

    /** Creates new form Menyu */
    public Menyu() {
    SetTitle("Menu Bar Example");
    setSize(200, 350);

    JMenuBar menuBar=new JMenuBar();
    setJMenuBar(menuBar);




    JMenu fileMenu=new JMenu("File");
    JMenu editMenu=new JMenu("Edit");
    JMenu viewMenu=new JMenu("View");

    menuBar.add(fileMenu);
    menuBar.add(editMenu);
    menuBar.add(viewMenu);


    JMenuItem newAction =new JMenuItem("New");
    JMenuItem openAction =new JMenuItem("open");
    JMenuItem exitAction =new JMenuItem("Exit");
    JMenuItem cutAction =new JMenuItem("Cut");
    JMenuItem copyAction =new JMenuItem("Copy");
    JMenuItem pasteAction =new JMenuItem("Paste");

    JMenuItem toolbarsAction=new JMenuItem("toolbarsAction");

    fileMenu.add(newAction);
    fileMenu.add(openAction);
    fileMenu.add(newAction);
    fileMenu.addSeparator();
    fileMenu.add(exitAction);
    fileMenu.add(cutAction);
    fileMenu.add(copyAction);
    fileMenu.add(pasteAction);
    fileMenu.addSeparator();
    viewMenu.add(toolbarsAction);

    newAction.addActionListener(new ActionListener() {

    public void actionPerformed(ActionEvent arg0) {
    System.out.println("You clicked a new Action");
    }
    });
    }
    public static void main(String[] args) {
    Menyu m=new Menyu();
    m.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    m.setVisible(true);
    }


    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout .Alignment.LEADING)
    .addGap(0, 400, Short.MAX_VALUE)
    );
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout .Alignment.LEADING)
    .addGap(0, 300, Short.MAX_VALUE)
    );
    }// </editor-fold>

    private void SetTitle(String string) {
    throw new UnsupportedOperationException("Not yet mplemented");
    }

    private void setJMenuBar(JMenuBar menuBar) {
    throw new UnsupportedOperationException("Not yet implemented");
    }

    private void setDefaultCloseOperation(int EXIT_ON_CLOSE) {
    throw new UnsupportedOperationException("Not yet implemented");
    }


    // Variables declaration - do not modify
    // End of variables declaration

    }




    run:
    Exception in thread "main" java.lang.UnsupportedOperationException: Not yet mplemented
    at menubar.Menyu.SetTitle(Menyu.java:103)
    at menubar.Menyu.<init>(Menyu.java:29)
    at menubar.Menyu.main(Menyu.java:75)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 2 seconds)



    What problem can be??

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

    Default Re: Help Please!!!

    Your SetTitle( ... ) method did that; did you write the code yourself?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Help Please!!!

    Java Code:
    private void SetTitle(String string) {
        throw new UnsupportedOperationException("Not yet mplemented");
    }
    Is that offensive defensive programming?

Posting Permissions

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