0

i have a project ,and i don't know how to run it in netbean ide - i am a begineer in java2e - i got a project in which some notepad like screen is there when running -jar exe file - and a option is there for compile and running applet -
please give me any tip to understand it -
reply soon -

3
Contributors
10
Replies
11
Views
6 Years
Discussion Span
Last Post by stultuske
0

and what do you mean run in netbeans? as a part of a bigger application, or do you want to edit the code of the application you are talking about.

0

its a private stuff - but i have to submit a project in urgency in my college -
so please just give me tips how to run a netbean ide project -
plz help me if you can - or give me ur mail id - i ll send you the whole project - u jus check it -n give me tips -
please its a huge request dear -

0

If it is project(you have source code) created with IDE (NetBeans) you just hit Run and that will take care of clean+compile+execute if there are no errors. However I'm not aware of possibility to run directly JAR from IDE

0

If it is project(you have source code) created with IDE (NetBeans) you just hit Run and that will take care of clean+compile+execute if there are no errors. However I'm not aware of possibility to run directly JAR from IDE

yeah its running -i hv done it -but the output is a notepad like screen in which new ,open ,save,save as ,compile applet code, run applet buttons are there -

so i want to know what should i write on this ide to complile or what basically is this -
its not my project - i don't know even what this do?
and how?

0

Can you post some screenshots what you actually seing, as from above description none would be any wise.

i attached a screenshot -please check it out

0

It seems to be some sort of GUI with two text areas and some menu options. What can it do I have no idea and expect nobody else here. You seems to be given assignment and one of your classmates shared solution with you...

0

It seems to be some sort of GUI with two text areas and some menu options. What can it do I have no idea and expect nobody else here. You seems to be given assignment and one of your classmates shared solution with you...

see this - now can you get anything -

Attachments
import java.awt.event.WindowEvent;
import javax.swing.*;
import javax.swing.text.*;
import javax.swing.JMenuBar;
import javax.swing.JPanel;
import javax.swing.JFrame;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.WindowAdapter;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;

public class WinInt extends JPanel implements ActionListener {

    JFileChooser fc;
    static JTextArea tArea;
    static JTextArea eArea;
    public Action co,  cu,  pas,  sel,cut1;
    private JScrollPane textComp,  errorComp;
    WinInt wi;
    static File file = null;
    static JFrame frame;
    JPanel textPanel, menuPanel, errorPanel;
    JMenuItem nw, open, save, saveas, exit;
    static int saved = 1;
    static String pathName, fileName, dirPath;
    static Process p;
    static boolean compilingSuccess = false;
    static int ans;
    final static Color HILIT_COLOR = Color.ORANGE;
    static Highlighter hilit;
    static Highlighter.HighlightPainter painter;
    static int index,  end = 0;
    static int showd = 0;
    static int runcount=0;
    JMenuBar mb = new JMenuBar();
    JMenu fMenu = new JMenu();
    JMenu eMenu = new JMenu();
    JMenu cMenu = new JMenu();
    JMenu hMenu = new JMenu();
    JToolBar tb = new JToolBar(0);
    

    //declaring image icons
      
        ImageIcon c = new ImageIcon("C:/Documents and Settings/abc/My Documents/NetBeansProjects/images/Cut24.gif");
        ImageIcon cop = new ImageIcon("C:/Documents and Settings/abc/My Documents/NetBeansProjects/images/Copy24.gif");
        ImageIcon past = new ImageIcon("C:/Documents and Settings/abc/My Documents/NetBeansProjects/images/Paste24.gif");
        ImageIcon op= new ImageIcon("C:/Documents and Settings/abc/My Documents/NetBeansProjects/images/Open24.gif");
        ImageIcon nw1 = new ImageIcon("C:/Documents and Settings/abc/My Documents/NetBeansProjects/images/New24.gif");
        ImageIcon save1 = new ImageIcon("C:/Documents and Settings/abc/My Documents/NetBeansProjects/images/Save24.gif");
        ImageIcon run1 = new ImageIcon("C:/Documents and Settings/abc/My Documents/NetBeansProjects/images/Run.gif");
        ImageIcon runapp1 = new ImageIcon("C:/Documents and Settings/abc/My Documents/NetBeansProjects/images/Applet24.gif");
        ImageIcon compile1 = new ImageIcon("C:/Documents and Settings/abc/My Documents/NetBeansProjects/images/Compile24.gif");
        ImageIcon find1 = new ImageIcon("C:/Documents and Settings/abc/My Documents/NetBeansProjects/images/Find24.gif");



//**********************************************************************************************************************************//

    // default constructor

    public WinInt() {

        super(new BorderLayout());


        fc = new JFileChooser();

        menuPanel = new JPanel();

        textPanel = new JPanel(new BorderLayout());


        tArea = new JTextArea(600, 600);
        tArea.addKeyListener(new KeyAdapter() {

            public void keyPressed(KeyEvent e) {
                saved = 0;
            }
        });


        textComp = new JScrollPane(tArea);
        textComp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
        textComp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

        textPanel.add(textComp);
        textPanel.setSize(600, 600);

        errorPanel = new JPanel(new BorderLayout());
        eArea = new JTextArea(10, 10);

        errorComp = new JScrollPane(eArea);
        errorComp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
        errorComp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

        errorPanel.add(errorComp);


     
// *****************************************************************************//

        cu = tArea.getActionMap().get(DefaultEditorKit.cutAction);
        pas = tArea.getActionMap().get(DefaultEditorKit.pasteAction);
        co = tArea.getActionMap().get(DefaultEditorKit.copyAction);
        sel=tArea.getActionMap().get(DefaultEditorKit.selectAllAction);




        //adding toolbar
        
        // declaring toolbar bu/ttons
        JButton nw2 = new JButton(nw1);
        nw2.setActionCommand("New");
        JButton o = new JButton(op);
        nw2.setToolTipText("New");
        o.setActionCommand("Open");
        o.setToolTipText("Open");
        JButton s = new JButton(save1);
        s.setToolTipText("Save");
        s.setActionCommand("Save");
        JButton cu1 = new JButton(c);
        cu1.setAction(cu);
        cu1.setIcon(c);
        cu1.setText("");
        cu1.setToolTipText("Cut");

//        cu1.setActionCommand("Cut");
        JButton co1 = new JButton(cop);
        co1.setAction(co);
        co1.setIcon(cop);
        co1.setText("");
        co1.setToolTipText("Copy");
//        co1.setActionCommand("Copy");
       
        JButton pa = new JButton(past);
        pa.setAction(pas);
        pa.setIcon(past);
        pa.setText("");
        pa.setToolTipText("Paste");

//        pa.setActionCommand("Paste");
        
        JButton f1 = new JButton(find1);
        f1.setActionCommand("Find");
        f1.setToolTipText("Find");
        JButton ru = new JButton(run1);
        ru.setActionCommand("Run");
        ru.setToolTipText("Run");
        JButton ruap = new JButton(runapp1);
        ruap.setActionCommand("Run Applet");
        ruap.setToolTipText("Run Applet");
        JButton com = new JButton(compile1);
        com.setActionCommand("Compile");
        com.setToolTipText("Compile");

        // adding buttons action listeners
        o.addActionListener(this);
        nw2.addActionListener(this);
        s.addActionListener(this);
        cu1.addActionListener(this);
        co1.addActionListener(this);
        pa.addActionListener(this);
        f1.addActionListener(this);
        ru.addActionListener(this);
        ruap.addActionListener(this);
        com.addActionListener(this);

        //adding buttons on toolbar
        tb.add(nw2);
        tb.add(o);
        tb.add(s);
        tb.addSeparator();
        tb.add(cu1);
        tb.add(co1);
        tb.add(pa);
        tb.addSeparator();
        tb.add(f1);
        tb.addSeparator();
        tb.add(com);
        tb.add(ru);
        tb.add(ruap);
//**************************************************************************************//
        //defining menu items
         
        filemenu();
        editmenu();
        codemenu();
        helpmenu();
        
 //***************************************************************************//
        
        // adding menu items on menubar
        
        mb.add(fMenu);
        mb.add(eMenu);
        mb.add(cMenu);
        mb.add(hMenu);

        // adding menubar and toolbar to the menu panel
        menuPanel.setLayout(new BorderLayout());
        menuPanel.add(mb, BorderLayout.NORTH);
        menuPanel.add(tb, BorderLayout.SOUTH);
       


        hilit = new DefaultHighlighter();
        painter = new DefaultHighlighter.DefaultHighlightPainter(HILIT_COLOR);
        tArea.setHighlighter(hilit);


//*******************************************************************************/

        add(menuPanel, BorderLayout.NORTH);
        add(textPanel, BorderLayout.CENTER);
        add(errorComp, BorderLayout.SOUTH);

    }   // end of default constructor
 //***************************************************************************//

public void filemenu()
{
// to define the file menu
    
        fMenu.setText("File");
        fMenu.setMnemonic(KeyEvent.VK_F);

        //defining new item in file menu

        fMenu.add(nw = new JMenuItem("New", new ImageIcon("C:/Documents and Settings/abc/My Documents/NetBeansProjects/images/New24.gif")));
        nw.setMnemonic(KeyEvent.VK_N);
        nw.setAccelerator(
                KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));
        //defining open item in file menu

        fMenu.add(open = new JMenuItem("Open", new ImageIcon("C:/Documents and Settings/abc/My Documents/NetBeansProjects/images/Open24.gif")));
        open.setMnemonic(KeyEvent.VK_O);
        open.setAccelerator(
                KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK));
        //defining save item in file menu

        fMenu.add(save = new JMenuItem("Save", new ImageIcon("C:/Documents and Settings/abc/My Documents/NetBeansProjects/images/Save24.gif")));
        save.setMnemonic(KeyEvent.VK_S);
        save.setAccelerator(
                KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK));
        //defining saveas item in file menu

        fMenu.add(saveas = new JMenuItem("Save As...", new ImageIcon("C:/Documents and Settings/abc/My Documents/NetBeansProjects/images/SaveAs24.gif")));

        fMenu.addSeparator();
        
        //defining exit item in file menu

        fMenu.add(exit = new JMenuItem("Exit"));
        exit.setMnemonic(KeyEvent.VK_X);
        exit.setAccelerator(
                KeyStroke.getKeyStroke(KeyEvent.VK_E, ActionEvent.CTRL_MASK));


        nw.addActionListener(this);
        open.addActionListener(this);
        save.addActionListener(this);
        saveas.addActionListener(this);
        exit.addActionListener(this);

}
public void editmenu()
{
        // to define the edit menu
    
        eMenu.setText("Edit");
        eMenu.setMnemonic(KeyEvent.VK_E);
        JMenuItem cut, copy, paste, find, selectall;

        //defining the cut menu item in the edit menu

        eMenu.add(cut = new JMenuItem("Cut"));//, new ImageIcon("C:/Documents and Settings/abc/My Documents/NetBeansProjects/images/Cut24.gif")));

        
        //setting action, icon display text
0

except for an explanation from your part, obviously. Is this a school assignment, and, more importantly, did you write (understand) the code yourself?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.