Event handling in JMenu in JPanel

Hi,
I'm writing a small register program GUI. I have a problem with ActionListener in JMenu. I wrote a JPanel which creates a JMenu and that works just fine. The problem is that id doesn't give any event signals. I have another class which impelemets ActionListener and it works fine with JButton (another panel for buttons), but not with JMenu.
Below is the JPanel for JMenu and Application which implements the ActionListener. Do you see anything wrong? I really can't imagine why I cannot get the action signals. JPanel is defined in JFrame as it should be. Have you got any ideas?
Regards,
Marko
class MenuPanel extends JPanel {
     protected JMenuBar menuBar;
     protected JMenu menu;
     protected JMenuItem loadRegister;
     protected JMenuItem saveRegister;
     protected JMenuItem information;
     protected JMenuItem quit;
     public MenuPanel(Application application) {
          menuBar = new JMenuBar();          
          menu = new JMenu("Tiedosto");     
          loadRegister = new JMenuItem("Lataa");
          loadRegister.addActionListener(application);
          saveRegister = new JMenuItem("Talleta");
          saveRegister.addActionListener(application);
          information = new JMenuItem("Tietoja");
          information.addActionListener(application);
          quit = new JMenuItem("Lopeta");                    quit.addActionListener(application);
          menu.add(loadRegister);
          menu.add(saveRegister);
          menu.addSeparator();
          menu.add(information);
          menu.add(quit);          
          menuBar.add(menu);
class Application implements ActionListener {     
     // Define CardPanel
     private CardPanel cardPanel;
     // Define linked list for cards
     private CardList cardList = null;
     // Constructor. Initializes cardPanel and cardList
     public Application(CardPanel cardPanelRefrence) {
          cardPanel = cardPanelRefrence;
          cardList = new CardList();
     public void actionPerformed(ActionEvent action) {
          String actionPerformed = action.getActionCommand();
          if (actionPerformed.equals("Lataa")) {
               load();          
          if (actionPerformed.equals("Talleta")) {
               save();          
          if (actionPerformed.equals("Tietoja")) {
               info();          
          if (actionPerformed.equals("Lopeta")) {
               System.exit(0);
// Continues with the methods...

Well, I found the answer. Heh, quite easy one but it took a while before I found it..
Just if you ever have similar problem. The problem was that in my JFrame I didn't create an object of class (Application) which implement s the ActionListener before using it as a reference in creating JPanel object. Quite confusing explanation, but here the code. This code was in my JFrame which was not included in this question.
private Application application;
private MenuPanel menuPanel;
application = new Application(cardPanel, rightInfoPanel);
menuPanel = new MenuPanel(application);
These two were introduced other way round, so that variable "application" was null. What a problem in fact.. :)
- Marko

Similar Messages

  • Question on program structure about event handling in nested JPanels in GUI

    Hi All,
    I'm currently writing a GUI app with a wizard included in the app. I have one class that acts as a template for each of the panels in the wizard. That class contains a JPanel called contentsPanel that I intend to put the specific contents into. I also want the panel contents to be modular so I have a couple of classes for different things, e.g. name and address panel, etc. these panels will contain checkboxes and the like that I want to event listeneres to watch out for. Whats the best way of implementing event handling for panel within panel structure? E.g for the the checkbox example,would it be a good idea to have an accessor method that returns the check book object from the innerclass/panel and use an addListener() method on the returned object in the top level class/panel. Or is it better to have the event listeners for those objects in the same class? I would appreciate some insight into this?
    Regards!

    MyMainClass.main(new String[] { "the", "arguments" });
    // or, if you defined your main to use varags (i.e. as "public static void main(String... args)") then you can just use
    MyMainClass.main("the", "arguments");But you should really extract your functionality out of the main method into meaningful classes and methods and just use those from both your console code and your GUI code.

  • Beginners Questions about Multiple JPanels in JFrame and event handling

    I am a newbie with SWING, and even a newerbie in Event Handling. So here goes.
    I am writing a maze program. I am placing a maze JPanel (MazePanel) at the center of a JFrame, and a JPanel of buttons (ButtonPanel) on the SOUTH pane. I want the buttons to be able to re-randomize the maze, solve the maze, and also ouput statistics (for percolation theory purposes). I have the backbone all done already, I am just creating the GUI now. I am just figuring out EventHandlers and such through the tutorials, but I have a question. I am adding an ActionListener to the buttons which are on the ButtonPanel which are on JFrame (SOUTH) Panel. But who do I make the ActionListener--Basically the one doing the work when the button is pressed. Do I make the JFrame the ActionListener or the MazePanel the ActionListener. I need something which has access to the maze data (the backbone), and which can call the Maze.randomize() function. I'm trying to make a good design and not just slop too.
    Also I was wondering if I do this
    JButton.addActionListener(MazePanel), and lets say public MazePanel implments ActionListenerdoesn't adding this whole big object to another object (namely the button actionlistener) seem really inefficient? And how does something that is nested in a JPanel on JFrame x get information from something nested in another JPanel on a JFrame x.
    Basically how is the Buttons going to talk to the maze when the maze is so far away?

    I'm not an expert, but here's what I'd do....
    You already have your business logic (the Maze classes), you said. I'm assuming you have some kind of public interface to this business logic. I would create a new class like "MazeGui" that extends JFrame, and then create the GUI using this class. Add buttons and panels as needed to get it to look the way you want. Then for each button that does a specific thing, add an anonymous ActionListener class to it and put whatever code you need inside the ActionListener that accesses the business logic classes and does what it needs to.
    This is the idea, though my code is totally unchecked and won't compile:
    import deadseasquirrels.mazestuff.*;
    public class MazeGui extends JFrame {
      JPanel buttonPanel = new JPanel();
      JPanel mazePanel = new JPanel();
      JButton randomizeB = new JButton();
      JButton solveB = new JButton();
      JButton statsB = new JButton();
      // create instanc(es) of your Maze business logic class(es)
      myMaze = new MazeClass();
      // add the components to the MazeGui content pane
      Component cp = getContentPane();
      cp.add(); // this doesn't do anything, but in your code you'd add
                // all of your components to the MazeGui's contentpane
      randomizeB.addActionListener(new ActionListener {
        void actionPerformed() {
          Maze newMaze = myMaze.getRandomMazeLayout();
          mazePanel.setContents(newMaze); // this is not a real method!
                                          // it's just to give you the idea
                                          // of how to manipulate the JPanel
                                          // representing your Maze diagram,
                                          // you will probably be changing a
                                          // subcomponent of the JPanel
      solveB.addActionListener(new ActionListener {
        void actionPerformed() {
          Solution mySolution = myMaze.getSolution();
          mazePanel.setContents(mySolution); // again, this is not a real
                                             // method but it shows you how
                                             // the ActionListener can
                                             // access your GUI
      // repeat with any other buttons you need
      public static void main(String[] args) {
        MazeGui mg = new MazeGui();
        mg.setVisible(true);
        // etc...
    }

  • Event Handling between JPanels

    Hi everyone,
    I'm trying a three-fold assignment on java, which relates to graphs and finding strongly connected components.
    In the first part, the user can create his own graph and the program should find all SCC and display them.
    In the second part, the program creates random graphs and then finds all SCC and displays them.
    In the third part, some statistical data is to be displayed.
    So what I have done so far is that I have created a JFrame on which I have added 3 JPanels, each for every part of the assignment.
    Changing between the JPanels is done by a JTabbedPane.
    My problem lies on the second part. I've created a class called RandomGraphPanel, which extends JPanel. Then I've created two sub-JPanels,
    called RandomGraphAreaPanel, where the graph should be displayed and RandomGraphDataPanel, where the user can choose some parameters on which the random graph is based. I don't know how I can paint the graph on the first sub-JPanel, after pressing a button on the second sub-JPanel.
    I will include some code from my classes:
    public class RandomGraphPanel extends JPanel
         private JPanel graphArea;
         private RandomGraphDataPanel data;
         private RandomGraphAreaPanel area;
         public RandomGraphPanel()
              super();
              setLayout(new BorderLayout(5,5));
              data = new RandomGraphDataPanel();
              area = new RandomGraphAreaPanel();
              add(data, BorderLayout.SOUTH);
              add(area, BorderLayout.CENTER);          
         }//RandomGraphPanel constructor
    }//RandomGraphPanel class
    public class RandomGraphDataPanel extends JPanel
         public RandomGraphDataPanel()
              super();
              //part where RandomGraphDataPanel is filled with 2 JSliders and 1 JButton
         }//RandomGraphDataPanel constructor
         private class ButtonHandler implements ActionListener
              public void actionPerformed(ActionEvent event)
                   //code that is executed when the button is pressed               
              }//actionPerformed
         }//ButtonHandler private class
    }//RandomGraphDataPanel classAny help will be appreciated.
    Thanks,
    philimonas

    Probably the best way would be to somehow implement the MVC pattern here. Another way would be to move the button handling code out of the RandomGraphDataPanel class and into the RandomGraphPanel class. You could then pass the ActionListener into the RandomGraphDataPanel object by perhaps a constructor parameter, or by a separate addActionListener method that you have created. Something like so:
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JPanel;
    public class RandomGraphPanel extends JPanel
        private JPanel graphArea;
        private RandomGraphDataPanel data;
        private RandomGraphAreaPanel area;
        public RandomGraphPanel()
            super();
            setLayout(new BorderLayout(5, 5));
            // *** passing ActionListener to the data class via constructor parameter
            data = new RandomGraphDataPanel(new ButtonHandler());
            area = new RandomGraphAreaPanel();
            add(data, BorderLayout.SOUTH);
            add(area, BorderLayout.CENTER);    
        // *** move this code into this class
        private class ButtonHandler implements ActionListener
            public void actionPerformed(ActionEvent event)
                area.showGraph();  // or whatever is needed to show graph       
    }and
    //import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JPanel;
    public class RandomGraphDataPanel extends JPanel
        public RandomGraphDataPanel(ActionListener buttonHandler)
            super();
            JButton someButton = new JButton("Show Graph");
            someButton.addActionListener(buttonHandler);
        private class ButtonHandler implements ActionListener
            public void actionPerformed(ActionEvent event)
                //code that is executed when the button is pressed         
    }

  • How to add event handling for a menu?

    hi,
    I have created a menu and few mneu items.
    for eachmenu itme , i did event handling and it is workign fine.
    it was like this
    menuItem = new JMenuItem("Exit",KeyEvent.VK_X);
    menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK));
    menuItem.addActionListener(this);
    menu.add(menuItem);
         public void actionPerformed(ActionEvent e)
    JMenuItem source = (JMenuItem)(e.getSource());
    String s = "Action event detected. Event source: " + source.getText();
    System.out.println(s);     
    public void itemStateChanged(ItemEvent e)
    JMenuItem source = (JMenuItem)(e.getSource());
    String s = "Item event detected. Event source: " + source.getText();
    System.out.println(s);
    now int he second menu i don't have any menu item and i want to do the event handling for the menu itself. any ideas how to do it. following is the code for the menu
    //Build the second menu.
    menu2 = new JMenu("Options");
    menu2.setMnemonic(KeyEvent.VK_O);
    menuBar.add(menu2);
    menu2.addActionListener(this);     //this does nto work

    You were on the right track. However, selecting a menu is different from selecting a menu item. MenuItem chucks an ActionEvent and Menu will send an ItemEvent.
    If you pile all action output to one actionPerformed method then be careful of your assumptions on what the source type will be. If by any chance the Menu has sent an ActinoEvent then your code will have caused a ClassCastException.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MenuTest implements ActionListener, ItemListener {
        JMenuItem menuItem;
        JMenu menu1, menu2;
        JMenuBar menubar;
        JFrame frame;
        public MenuTest() {
            frame = new JFrame("MenuTest");
            frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
            menubar = new JMenuBar();
            frame.setJMenuBar(menubar);
            menu1 = new JMenu("File");
            menu1.setMnemonic(KeyEvent.VK_F);
            menuItem = new JMenuItem("Exit",KeyEvent.VK_X);
            menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK));
            menuItem.addActionListener(this);
            menu1.addItemListener(this);
            menu1.add(menuItem);
            menubar.add(menu1);
            //Build the second menu.
            menu2 = new JMenu("Options");
            menu2.setMnemonic(KeyEvent.VK_O);
            menu2.addActionListener(this); //this does not work
            menu2.addItemListener(this); // use this instead
            menubar.add(menu2);
            JPanel panel = new JPanel();
            panel.setPreferredSize(new Dimension(100,100));
            frame.getContentPane().add(panel);
            frame.pack();
            frame.show();
        public void actionPerformed(ActionEvent e)
            String s = "Action event detected. Event source: " + e.getSource();
            System.out.println(s);
        public void itemStateChanged(ItemEvent e)
            String s = "Item event detected. Event source: " + e.getSource();
            System.out.println(s);
        public static void main(String[] args) {
            new MenuTest();
    }

  • Event handling in JList

    hello to all!!!
    i am having a problem in JList event handling.Following is my code--
    public void valueChanged(ListSelectionEvent  lse)
    {index = list.getSelectedIndex();
    if(index==0)
                     System.out.println( "index"+index);
                     System.out.println("1st frame now opened");
               JFrame f2=new JFrame();
                    JPanel p1=new JPanel();
              f2.getContentPane().add(p1);                    
              JLabel l10=new JLabel("id");
              JTextField t100=new JTextField(20);
              p1.add(l10);
              p1.add(t100);
              p1.add(l11);//declared in constructor
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              f2.setVisible(true);
    if(index==1)
              System.out.println("now index is"+index);
              }My problem is that 2 frames get opened whenever index==0 .even the code written in System.out.println() is displayed 2 times on the screen.2 JFrames open up whenever index==0.i want that only 1 JFrame should be opened.and moreover 1 of the JFrame does not contain the JLabel that is declared in the constructor.and when index==1,then The index value is displayed 2 times on the screen.i want that only 1 value should be there.any help would be highly appreciated.thanks in advance.

    even after entering if (lse.getValueIsAdjusting())
    }index = list.getSelectedIndex();i am having the same value.my problem is not when value of index changes.even if i use only 1 st index (i.e. only click on academic record) than also 2 frames open up.i entered this code after if(index==0) and if if(index==1).but it was of no help.same problem of 2 times each event occuring is there.
    urgent Help required.any help would be highly appreciated.thnx in advance

  • Button Event Handler in a JList, Please help.

    Hi everyone,
    I have created a small Java application which has a JList. The JList uses a custom cell renderer I named SmartCellRenderer. The SmartCellRenderer extends JPanel and implements the ListCellRenderer. I have added two buttons on the right side inside the JPanel of the SmartCellRenderer, since I want to buttons for each list item, and I have added mouse/action listeners for both buttons. However, they don't respond. It seems that the JList property overcomes the buttons underneath it. So the buttons never really get clicked because before that happens the JList item is being selected beforehand. I've tried everything. I've put listeners in the Main class, called Editor, which has the JList and also have listeners in the SmartCellRenderer itself and none of them get invoked.
    I also tried a manual solution. Every time the event handler for the JList was invoked (this is the handler for the JList itself and not the buttons), I sent the mouse event object to the SmartCellRenderer to manually check if the point the click happened was on one of the buttons in order to handle it.
    I used:
    // Inside SmartCellRenderer.java
    // e is the mouse event object being passed from the Editor whenever
    // a JList item is selected or clicked on
    Component comp = this.getComponent (e.getX(), e.getY())
    if(!(comp instanceof JButton)) {
              System.out.println("Recoqnized Event, but not a button click...");
              //return;
    } else {
              System.out.println("Recognized Event, IT IS A MOUSE CLICK, PROCESSING...");
              System.out.println("VALUE: "+comp.toString());
    What I realized is that not only this still doesn't work (it never realizes the component as a JButton) it also throws an exception for the last line saying comp is null. Meaning with the passed x,y position the getComponent() returns a null which happens when the coordinates passed to it are outside the range of the Panel. Which is a whole other problem?
    I have yet to find an example on the web, using Google, that demonstrated using buttons inside a JList.
    Can anyone help me with this. Thanks.

    A renderer is not a component, so you can't click on it. A renderer is just used to paint a representation of a component at a certain position in your JList.
    I have yet to find an example on the web, using Google, that demonstrated using buttons inside a JList.Thats probably because this is not a common design. The following two designs are more common:
    a) Create a separate panel for your JButtons. Then when you click on the button it would act on each selected row in the JList
    b) Or maybe like windows explorer. Select the items in the list and then use a JPopupMenu to perform the desired functionality.
    I've never tried to add a clickable button to a panel, but this [url http://forum.java.sun.com/thread.jspa?threadID=573721]posting shows one way to add a clickable JButton as a column in a JTable. You might be able to use some of the concepts to add 2 button to the JPanel or maybe you could use a JTable with 3 columns, one for your data and the last two for your buttons.

  • Event Handling Help needed please.

    Hi,
    I am writing a program to simulate a supermarket checkout. I have done the GUI and now i am trying to do the event handling. I have come up against a problem.
    I have a JCombobox called prodList and i have added an string array to it called prods . I have also created 2 more arrays with numbers in them.
    I want to write the code for if an item is selected from the combo box that the name from the array is shown in a textfield tf1, and also the price and stock no which correspond to the seclected item (both initialised in the other arrays) are also added to the textfield tf1.
    I have started writng the code but i am really stuck. Could someone please help me with this please. The code i have done so far is as follows(just the event handling code shown)
              public void ItemStateChange(ItemEvent ie){
              if(ie.getItemSelected()== prodList)
                   changeOutput();
              public void changeOutput()
                   if(ItemSelected ==0)
                        tf1.setText("You have selected" +a +b +c);
         }

    Do you say this because i missed the d of ItemStateChanged ?
    I have amended that but still i am getting the same errors class or enum expected. 4 of them relating to the itemStateChanged method.
    i will post my whole code if it helps
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.Observer;  //new
    import java.util.Observable;//new
    import javax.swing.BorderFactory;
    import javax.swing.border.Border;
    import javax.swing.border.TitledBorder;
    public class MySuperMktPro
         public MySuperMktPro()
              CheckoutView Check1 = new CheckoutView(1,0,0);
              CheckoutView Check2 = new CheckoutView(2,300,0);
              CheckoutView Check3 = new CheckoutView(3,600,0);
              CheckoutView Check4 = new CheckoutView(4,0,350);
              CheckoutView Check5 = new CheckoutView(5,600,350);
              OfficeView off111 = new OfficeView();
        public static void main(String[] args) {
             // TODO, add your application code
             System.out.println("Starting My Supermarket Project...");
             MySuperMktPro startup = new MySuperMktPro();
        class CheckoutView implements ItemListener , ActionListener
        private OfficeView off1;
         private JFrame chk1;
         private Container cont1;
         private Dimension screensize,tempDim;
         private JPanel pan1,pan2,pan3,pan4,pan5;
         private JButton buyBut,prodCode;
         private JButton purchase,cashBack,manual,remove,disCo;
         private JButton but1,but2,finaLi1,but4,but5,but6;
         private JTextArea tArea1,tArea2;
         private JTextField tf1,tf2,tf3,list2;
         private JComboBox prodList;
         private JLabel lab1,lab2,lab3,lab4,lab5,lab6,lab7;
         private int checkoutID; //New private int for all methods of this class
         private int passedX,passedY;
         private String prods[];
         private JButton rb1,rb2,rb3,rb4;
         private double price[];
         private int code[];
         public CheckoutView(int passedInteger,int passedX,int passedY)
              checkoutID = passedInteger; //Store the int passed into the method
            this.passedX = passedX;
            this.passedY = passedY;
              drawCheckoutGui();
         public void drawCheckoutGui()
              prods= new String[20];
              prods[0] = "Beans";
              prods[1] = "Eggs";
              prods[2] = "bread";
              prods[3] = "Jam";
              prods[4] = "Butter";
              prods[5] = "Cream";
              prods[6] = "Sugar";
              prods[7] = "Peas";
              prods[8] = "Milk";
              prods[9] = "Bacon";
              prods[10] = "Spaghetti";
              prods[11] = "Corn Flakes";
              prods[12] = "Carrots";
              prods[13] = "Oranges";
              prods[14] = "Bananas";
              prods[15] = "Snickers";
              prods[16] = "Wine";
              prods[17] = "Beer";
              prods[18] = "Lager";
              prods[19] = "Cheese";
              for(i=0; i<prods.length;i++);
              code = new int [20];
              code[0] = 1;
              code[1] = 2;
              code[2] = 3;
              code[3] = 4;
              code[4] = 5;
              code[5] = 6;
              code[6] = 7;
              code[7] = 8;
              code[8] = 9;
              code[9] = 10;
              code[10] = 11;
              code[11] = 12;
              code[12] = 13;
              code[13] = 14;
              code[14] = 15;
              code[15] = 16;
              code[16] = 17;
              code[17] = 18;
              code[18] = 19;
              code[19] = 20;
              for(b=0; b<code.length; b++);
              price = new double [20];
              price[0] = 0.65;
              price[1] = 0.84;
              price[2] = 0.98;
              price[3] = 0.75;
              price[4] = 0.45;
              price[5] = 0.65;
              price[6] = 1.78;
              price[7] = 1.14;
              price[8] = 0.98;
              price[9] = 0.99;
              price[10] = 0.98;
              price[11] = 0.65;
              price[12] = 1.69;
              price[13] = 2.99;
              price[14] = 0.99;
              price[15] = 2.68;
              price[16] = 0.89;
              price[17] = 5.99;
              price[18] = 1.54;
              price[19] = 2.99;
              for(c=0; c<code.length; c++);
              screensize = Toolkit.getDefaultToolkit().getScreenSize();
              chk1 = new JFrame();
              chk1.setTitle("Checkout #" + checkoutID); //Use the new stored int
              chk1.setSize(300,350);
              chk1.setLocation(passedX,passedY);
              chk1.setLayout(new GridLayout(5,1));
              //chk1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              cont1 = chk1.getContentPane();
              //chk1.setLayout(new BorderLayout());
                 pan1 = new JPanel();
                 pan2 = new JPanel();
              pan3 = new JPanel();
              pan4 = new JPanel();
              pan5 = new JPanel();
              //panel 1
              pan1.setLayout(new FlowLayout());
              pan1.setBackground(Color.black);          
              prodList = new JComboBox(prods);
              prodList.setMaximumRowCount(2);
              prodList.addItemListener(this);
              but1 = new JButton("Buy");
              but1.addActionListener(this);
              lab1 = new JLabel("Products");
              lab1.setForeground(Color.white);
              lab1.setBorder(BorderFactory.createLineBorder(Color.white));
              pan1.add(lab1);
              pan1.add(prodList);          
              pan1.add(but1);
              //panel 2
              pan2 = new JPanel();
              pan2.setLayout(new BorderLayout());
              pan2.setBackground(Color.black);
              lab3 = new JLabel("                                Enter Product Code");
              lab3.setForeground(Color.white);
              tArea2 = new JTextArea(8,10);
              tArea2.setBorder(BorderFactory.createLineBorder(Color.white));
              lab5 = new JLabel("  Tesco's   ");
              lab5.setForeground(Color.white);
              lab5.setBorder(BorderFactory.createLineBorder(Color.white));
              lab6 = new JLabel("Checkout");
              lab6.setForeground(Color.white);
              lab6.setBorder(BorderFactory.createLineBorder(Color.white));
              lab7 = new JLabel("You  selected                      ");
              lab7.setForeground(Color.cyan);
              //lab7.setBorder(BorderFactory.createLineBorder(Color.white));
              pan2.add(lab7,"North");
              pan2.add(lab6,"East");
              pan2.add(tArea2,"Center");
              pan2.add(lab5,"West");
              pan2.add(lab3,"South");
              //panel 3
              pan3 = new JPanel();
              pan3.setLayout(new FlowLayout());
              pan3.setBackground(Color.black);
              manual = new JButton("Manual");
              manual.addActionListener(this);
              manual.setBorder(BorderFactory.createLineBorder(Color.white));
              remove = new JButton("Remove");
              remove.addActionListener(this);
              remove.setBorder(BorderFactory.createLineBorder(Color.white));
              tf1 = new JTextField(5);
              pan3.add(manual);
              pan3.add(tf1);
              pan3.add(remove);
              //panel 4
              pan4 = new JPanel();
              pan4.setLayout(new FlowLayout());
              pan4.setBackground(Color.black);
              finaLi1 = new JButton("Finalise");
         //     finaLi1.addActionListener(this);
              cashBack = new JButton("Cashback");
              JTextField list2 = new JTextField(5);
              but4 = new JButton(" Sum Total");
              but4.addActionListener(this);
              but4.setBorder(BorderFactory.createLineBorder(Color.white));
              cashBack.setBorder(BorderFactory.createLineBorder(Color.white));
              pan4.add(cashBack);
              pan4.add(list2);
              pan4.add(but4);
              //panel 5
              pan5 = new JPanel();
              pan5.setLayout(new GridLayout(2,3));
              pan5.setBackground(Color.black);
              disCo = new JButton("Discount");
              disCo.addActionListener(this);
              disCo.setBorder(BorderFactory.createLineBorder(Color.black));
              but6 = new JButton("Finalise");
              but6.addActionListener(this);
              but6.setBorder(BorderFactory.createLineBorder(Color.black));
              rb1 = new JButton("Cash");
              rb1.addActionListener(this);
              rb1.setBorder(BorderFactory.createLineBorder(Color.black));
              rb2 = new JButton("Card");
              rb2.addActionListener(this);
              rb2.setBorder(BorderFactory.createLineBorder(Color.black));
              rb3 = new JButton("Cheque");
              rb3.addActionListener(this);
              rb3.setBorder(BorderFactory.createLineBorder(Color.black));
              rb4 = new JButton("Voucher");
              rb4.addActionListener(this);
              rb4.setBorder(BorderFactory.createLineBorder(Color.black));
              pan5.add(disCo);
              pan5.add(but6);
              pan5.add(rb1);
              pan5.add(rb2);
              pan5.add(rb3);
              pan5.add(rb4);
              //add the panels to the container        
              cont1.add(pan1);
              cont1.add(pan4);     
              cont1.add(pan2);
              cont1.add(pan3);          
              cont1.add(pan5);          
              chk1.setContentPane(cont1);
              chk1.setVisible(true);     
    class OfficeView
         private OfficeView off111;
         private JFrame offMod1;
         private JPanel pane1;
         private JButton refill;
         private Container cont11;
         private Dimension screensize;
         private JTextField tf11,tf12;
         public OfficeView()
              drawOfficeGUI();
         public void drawOfficeGUI()
              screensize = Toolkit.getDefaultToolkit().getScreenSize();
              offMod1 = new JFrame("Office Control");
              int frameWidth = 300;
              int frameHeight = 250;
              offMod1.setSize(frameWidth,frameHeight);
              offMod1.setLocation(300,350);
              offMod1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              cont11 = offMod1.getContentPane();
              pane1 = new JPanel();
              pane1.setBackground(Color.cyan);
              refill = new JButton("Refill");
              tf11 = new JTextField(25);
              tf12 = new JTextField(25);
              pane1.add(tf11);
              pane1.add(refill);
              pane1.add(tf12);
              cont11.add(pane1);
              offMod1.setContentPane(cont11);
              offMod1.setVisible(true);
              public void ItemStateChanged(ItemEvent ie)
                        if(ie.getItemSelected()== prodList)
                                  changeOutput();
              public void changeOutput()
                        if(ItemSelected ==0)
                                  tf1.setText("You have selected", +a +b +c);
                   }Message was edited by:
    fowlergod09

  • GUI event handling problems appear in 1.4.1 vs. 1.3.1?

    Hi,
    Has anyone else experienced strange event handling problems when migrating from 1.3.1 to 1.4.1? My GUI applications that make use of Swing's AbstractTableModel suddenly don't track mouse and selection events quickly anymore. Formerly zippy tables are now very unresponsive to user interactions.
    I've run the code through JProbe under both 1.3 and 1.4 and see no differences in the profiles, yet the 1.4.1 version is virtually unusable. I had hoped that JProbe would show me that some low-level event-handling related or drawing method was getting wailed on in 1.4, but that was not the case.
    My only guess is that the existing installation of 1.3.1 is interfering with the 1.4.1 installation is some way. Any thoughts on that before I trash the 1.3.1 installation (which I'm slightly reluctant to do)?
    My platform is Windows XP Pro on a 2GHz P4 with 1GB RAM.
    Here's my test case:
    import javax.swing.table.AbstractTableModel;
    import javax.swing.*;
    import java.awt.*;
    public class VerySimpleTableModel extends AbstractTableModel
    private int d_rows = 0;
    private int d_cols = 0;
    private String[][] d_data = null;
    public VerySimpleTableModel(int rows,int cols)
    System.err.println("Creating table of size [" + rows + "," + cols +
    d_rows = rows;
    d_cols = cols;
    d_data = new String[d_rows][d_cols];
    int r = 0;
    while (r < d_rows){
    int c = 0;
    while (c < d_cols){
    d_data[r][c] = new String("[" + r + "," + c + "]");
    c++;
    r++;
    System.err.println("Done.");
    public int getRowCount()
    return d_rows;
    public int getColumnCount()
    return d_cols;
    public Object getValueAt(int rowIndex, int columnIndex)
    return d_data[rowIndex][columnIndex];
    public static void main(String[] args)
    System.err.println( "1.4..." );
    JFrame window = new JFrame();
    window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JPanel panel = new JPanel();
    Dimension size = new Dimension(500,500);
    panel.setMinimumSize(size);
    panel.setMaximumSize(size);
    JTable table = new JTable(new VerySimpleTableModel(40,5));
    panel.add(table);
    window.getContentPane().add(panel);
    window.setSize(new Dimension(600,800));
    window.validate();
    window.setVisible(true);
    Thanks in advance!!
    - Dean

    Hi,
    I've fixed the problem by upgrading to 1.4.1_02. I was on 1.4.1_01.
    I did further narrow down the symptoms more. It seemed the further the distance from the previous mouse click, the longer it would take for the table row to highlight. So, clicking on row 1, then 2, was much faster than clicking on row 1, then row 40.
    If no one else has seen this problem -- good! I wouldn't wish the tremendous waste of time I've had on anyone!
    - Dean

  • New window in event handling

    hi to all
    i m beginner in java programming and i want to do event handling on mouse click. i have a button and i want if i click that button a new window open
    can anyone help me

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class ActionEvents implements ActionListener
        JDialog dialog;
        public ActionEvents(JFrame f)
            dialog = new JDialog(f, "dialog");
            dialog.getContentPane().add(new JLabel("hello world", JLabel.CENTER));
            dialog.setSize(200,100);
            dialog.setLocation(425,200);
        public void actionPerformed(ActionEvent e)
            if(!dialog.isVisible())
                dialog.setVisible(true);
            else
                dialog.toFront();
        private JPanel getPanel()
            JButton button = new JButton("open dialog");
            button.addActionListener(this);
            JPanel panel = new JPanel();
            panel.add(button);
            return panel;
        public static void main(String[] args)
            JFrame f = new JFrame();
            ActionEvents ae = new ActionEvents(f);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(ae.getPanel(), "North");
            f.setSize(200,100);
            f.setLocation(200,200);
            f.setVisible(true);
    }

  • JMenuBar Event Handling

    I am customizing my own menu bar, I would like to create some event handling, for the top most level, it is not a problem, but when I try to implement some event handling for the drop-down list/menu, nothing happens.
    The following is the whole class:
    package diagramillustrator;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class DIM extends JMenuBar implements MouseListener
         * Creates a new instance of DIM
        public DIM()
            configFileMenu();
            configOptionsMenu();
            configAllItems();
            configMenuBar();
        //Creation and Initialization of objects
        //<editor-fold>    
        //file and options menus to be added to the menubar
        JMenu fileMenu =  new JMenu("File");
        JMenu optionsMenu = new JMenu("Options");
        //file items
        JMenuItem newItem = new JMenuItem("New");
        JMenuItem openItem = new JMenuItem("Open");
        JMenuItem saveItem = new JMenuItem("Save");
        JMenuItem printItem = new JMenuItem("Print");
        JMenuItem exitItem = new JMenuItem("Exit");
        //options items
        JMenuItem createFileItem = new JMenuItem("Create properties file");
        JMenuItem propertiesItem = new JMenuItem("Properties");
        //</editor-fold>
        //adds mouse listener to every item
        private void configAllItems()
            this.addMouseListener(this);
            fileMenu.addMouseListener(this);
            optionsMenu.addMouseListener(this);
            newItem.addMouseListener(this);
            openItem.addMouseListener(this);
            saveItem.addMouseListener(this);
            printItem.addMouseListener(this);
            exitItem.addMouseListener(this);
            createFileItem.addMouseListener(this);
            propertiesItem.addMouseListener(this);
        //creats the file menu
        private void configFileMenu()
            fileMenu.add(newItem);
            fileMenu.addSeparator();
            fileMenu.add(saveItem);
            fileMenu.add(openItem);
            fileMenu.add(printItem);
            fileMenu.addSeparator();
            fileMenu.add(exitItem);
        //creats the options menu
        private void configOptionsMenu()
            optionsMenu.add(createFileItem);
            optionsMenu.add(propertiesItem);
        //configures the menubar, adds all items to it etc
        private void configMenuBar()
            this.setLayout(new FlowLayout(FlowLayout.LEFT));
            this.add(fileMenu);
            this.add(new JSeparator(SwingConstants.VERTICAL));
            this.add(new JSeparator(SwingConstants.VERTICAL));
            this.add(optionsMenu);
            this.setToolTipText("Menu Bar");
        //event handling
        //<editor-fold>
        public void mouseClicked(MouseEvent e)
            //works
            //if(e.getSource().equals(fileMenu))this.setBackground(Color.yellow);
            //else this.setBackground(Color.black);
            //dowsn't work
            if(e.getSource().equals(newItem))this.setBackground(Color.yellow);
        public void mousePressed(MouseEvent e)
        public void mouseReleased(MouseEvent e)
        public void mouseEntered(MouseEvent e)
        public void mouseExited(MouseEvent e)
        //</editor-fold>
        //main method to test class
        public static void main(String[] args)
            JFrame f= new JFrame("Testing menu");
            f.setSize(400,400);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setJMenuBar(new DIM());
            f.show();
    } This is the troubling part:
    public void mouseClicked(MouseEvent e)
            //works
            //if(e.getSource().equals(fileMenu))this.setBackground(Color.yellow);
            //else this.setBackground(Color.black);
            //dowsn't work
            if(e.getSource().equals(newItem))this.setBackground(Color.yellow);
        } The first two lines work perfectly fine as they apply to the top most level, the rest doesn't do anything at all.
    Can anyone help me to handle events for the drop-down please?
    AndXer

    Sorry posted the prvious by mistake.
    Oh, I usually used MouseListener for buttons...I tried using ActionListener and it worked great, the only flaw is that any mouse button clicked triggers an event, I want the event to be triggered only when BUTTON_1 is clicked (like in MouseListener).
    Can that be done as I found nothing in the API. If yes, a code sample would be greatly appreciated.
    The current code for handling it is:
        if(e.getSource().equals(newItem))
             this.setBackground(Color.green);
    }Thanks,
    AndXer

  • Event handling from class to another

    i get toolbarDemo.java which make event handling to JTextArea in the same class
    http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/index.html#ToolBarDemo
    but i have another class and i make object of toolBar class and i move toolBar icons only how can i move the event handling as open ,save,copy,paste to my another class
    i want to ignore actionPerformed of toolBar class and listen to my another's class actionPerformed
    thanks

    Rather than trying to use the ToolBarDemo class as-is you can use/modify the methods in it for your own class, like this:
    import java.awt.*;
    import java.awt.event.*;
    import java.net.URL;
    import javax.swing.*;
    import javax.swing.text.TextAction;
    public class ToolBarIconTest implements ActionListener
        static final private String OPEN  = "open";
        static final private String SAVE  = "save";
        static final private String COPY  = "copy";
        static final private String PASTE = "paste";
        public void actionPerformed(ActionEvent e)
            String cmd = e.getActionCommand();
            if (OPEN.equals(cmd))
                System.out.println("show a JFileChooser open dialog");
            if (SAVE.equals(cmd))
                System.out.println("show a JFileChooser save dialog");
        private JToolBar getToolBar()
            JToolBar toolBar = new JToolBar();
            addButtons(toolBar);
            return toolBar;
        protected void addButtons(JToolBar toolBar) {
            JButton button = null;
            //first button
            button = makeGeneralButton("Open24", OPEN,
                                       "To open a document",
                                       "Open", this);
            toolBar.add(button);
            //second button
            button = makeGeneralButton("Save24", SAVE,
                                       "To save a document",
                                       "Save", this);
            toolBar.add(button);
            //third button
            button = makeGeneralButton("Copy24", COPY,
                                       "Copy from focused text component",
                                       "Copy", copy);
            toolBar.add(button);
            //fourth button
            button = makeGeneralButton("Paste24", PASTE,
                                       "Paste to the focused text component",
                                       "Paste", paste);
            toolBar.add(button);
        protected JButton makeGeneralButton(String imageName,
                                            String actionCommand,
                                            String toolTipText,
                                            String altText,
                                            ActionListener l) {
            //Look for the image.
            String imgLocation = "toolbarButtonGraphics/general/"
                                 + imageName
                                 + ".gif";
            URL imageURL = ToolBarIconTest.class.getResource(imgLocation);
            //Create and initialize the button.
            JButton button = new JButton();
            button.setActionCommand(actionCommand);
            button.setToolTipText(toolTipText);
            button.addActionListener(l);
            if (imageURL != null) {                      //image found
                button.setIcon(new ImageIcon(imageURL, altText));
            } else {                                     //no image found
                button.setText(altText);
                System.err.println("Resource not found: "
                                   + imgLocation);
            return button;
        private Action copy = new TextAction(COPY)
            public void actionPerformed(ActionEvent e)
                JTextComponent tc = getFocusedComponent();
                int start = tc.getSelectionStart();
                int end = tc.getSelectionEnd();
                if(start == end)
                    tc.selectAll();
                tc.copy();
        private Action paste = new TextAction(PASTE)
            public void actionPerformed(ActionEvent e)
                getFocusedComponent().paste();
        private JPanel getTextFields()
            JPanel panel = new JPanel(new BorderLayout());
            panel.add(new JTextField(12), "North");
            panel.add(new JTextField(12), "South");
            return panel;
        public static void main(String[] args)
            ToolBarIconTest test = new ToolBarIconTest();
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(test.getToolBar(), "North");
            f.getContentPane().add(test.getTextFields());
            f.setSize(360,240);
            f.setLocation(200,200);
            f.setVisible(true);
    }Use the -cp option as shown in the ToolBarDemo class comments
    C:\jexp>java -cp .;path_to_jar_file/jlfgr-1_0.jar ToolBarIconTest

  • Question about event handling in JComponents

    I have often found it useful to create a component that acts as an event handler for events the component generates itself. For example, a panel that listens for focus events that effect it and handle these events internally. (See below).
    My question is: Can this practice cause synchronization issues or any other type of problem that I need to watch out for? Is it good/bad or neither. Are there any issues I should be aware of?
    Thanks in advance for the help.
    Example:
    public class qPanel extends JPanel implements FocusListener
    public qPanel () {
    super.addFocusListener(this);
    public void focusGained(FocusEvent e) {
    //Do stuff
    public void focusLost(FocusEvent e) {
    //Do stuff
    }

    Hi,
    Handling events this way is completely fine and saves on number of classes. Only thing you may want to watch out for is that the handler methods have to be public. This means that someone could use your component and call one of the methods. For example, I could write:
    panel.focusGained(new FocusEvent(....))
    when it's not really gaining focus. So, if you're writing this component for re-use you might want to be aware of this.
    An alternative:
    Use a single internal class to handle all events. It can then delegate to private methods of your component. Example:
    class MyEventHandler implements FocusListener, MouseListener, etc... {
    public void focusGained(FocusEvent fe) {
    doFocusGained(fe);
    public void mousePressed(MouseEvent me) {
    doMousePressed(me);
    Then your component could have:
    private void doFocusGained(FocusEvent fe) {
    private void doMousePressed(MouseEvent me) {
    etc...
    Just ideas :)
    Thanks!
    Shannon Hickey (Swing Team)
    I have often found it useful to create a component
    that acts as an event handler for events the component
    generates itself. For example, a panel that listens
    for focus events that effect it and handle these
    events internally. (See below).
    My question is: Can this practice cause
    synchronization issues or any other type of problem
    that I need to watch out for? Is it good/bad or
    neither. Are there any issues I should be aware of?
    Thanks in advance for the help.
    Example:
    public class qPanel extends JPanel implements
    FocusListener
    public qPanel () {
    super.addFocusListener(this);
    public void focusGained(FocusEvent e) {
    //Do stuff
    public void focusLost(FocusEvent e) {
    //Do stuff

  • Event Handling for Graphic Shapes

    Hi guys,
    I have a problem on the implementation of a piece of software that i'm making, to be more specific i implement a GUI. In this GUI i draw rectangles, lines and that kind of things.
    The problem is that i want when clicking on a rectangle, an event to take place such as the drawing of something else, or a message, etc.
    How am i to achieve that? I've tried many things but didn't succeeded it unfortunately. How am i going to "give" life to my rectangles by adding event handling for them? What code should i write?
    Note: My class extends JPanel & i'm using paint(Graphics g) for drawing the shapes
    Thanks,
    John.

    Try this:
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.util.*;
    public class Shapes extends JFrame
         DPanel pan = new DPanel();
    public Shapes()
         addWindowListener(new WindowAdapter()
              public void windowClosing(WindowEvent ev)
                   dispose();
                   System.exit(0);
         setBounds(10,10,400,350); 
         setContentPane(pan);
         setVisible(true);
    public class DPanel extends JPanel implements MouseListener
         Vector shapes = new Vector();
         Shape  cs;
    public DPanel()
         addMouseListener(this);
         shapes.add(new Rectangle(20,20,100,40));
         shapes.add(new Rectangle(40,80,130,60));
         shapes.add(new Line2D.Double(20,150,200,180));
    public void paintComponent(Graphics g)
         super.paintComponent(g);
         Graphics2D g2 = (Graphics2D)g;
         for (int j=0; j < shapes.size(); j++)
              g2.draw((Shape)shapes.get(j));
         g.setColor(Color.red);
         if (cs != null) g2.draw(cs);
    public void mouseClicked(MouseEvent m) {}
    public void mouseEntered(MouseEvent m) {}
    public void mouseExited(MouseEvent m)  {}
    public void mouseReleased(MouseEvent m){}
    public void mousePressed(MouseEvent m)
         for (int j=0; j < shapes.size(); j++)
              Shape s = (Shape)shapes.get(j);
              Rectangle r = new Rectangle(m.getX()-1,m.getY()-1,2,2);
              if (s.intersects(r))
                   cs = s;
                   repaint();
    public static void main (String[] args) 
          new Shapes();
    }Noah

  • Event handling question

    I am very new to Swing....I am very confused about how event handling works. I created a button called "remove" and a list. When a user selects an item in the list and then clicks on the remove button, then the item should be deleted from the list. I am able to display the list and the button. I create a listener for the button in a separate class as follows:
    class MyActionListener implements ActionListener
    public void actionPerformed (ActionEvent e)
    if(e.getActionCommand().equals("remove"))
    {System.out.println("remove works");
    Now my problem is ..how do i access the list in this class..because my list is set up in the other class (main class). Because if i try to do anything with the list in this class it shows the compile time error saying it cannot identify what list is. Please tell me how i can use the list in the MyActionListener class. Here is the code that sets up the list:
    public abstract class VetNet extends JFrame implements ListSelectionListener
    static DefaultListModel listM= new DefaultListModel();
    static DefaultListModel listModel;
    public static void main (String[] args)throws IOException
    JPanel panel= new JPanel();
    JLabel j=new JLabel("Welcome");
    panel.add(j,BorderLayout.NORTH);
    BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer reader;
    reader=new StringTokenizer(stdin.readLine());
    String first_name=reader.nextToken();
    while(!first_name.equals("end"))
    { String last_name=reader.nextToken();
    add_name(first_name,last_name);
    reader=new StringTokenizer(stdin.readLine());
    first_name=reader.nextToken();
    }//while
    DefaultListModel listModel=new DefaultListModel();
    listModel=return_fname();
    String first= (String)(listModel.firstElement());
    JList sampleJList= new JList(listModel);
    sampleJList.setVisibleRowCount(2);
    // sampleJList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    //sampleJList.setSelectedIndex(0);
    //sampleJList.addListSelectionListener(sampleJList);
    JScrollPane listPane=new JScrollPane(sampleJList);
    panel.setBorder(BorderFactory.createEmptyBorder(60,60,30,60));
    panel.add(listPane);
    JButton b1=new JButton("add");
    panel.add(b1);
    JButton b2=new JButton("remove");
    panel.add(b2);
    JButton b3=new JButton("edit");
    panel.add(b3);
    JFrame frame = new JFrame ("VetNet");
    frame.getContentPane().add(panel);     
    frame.addWindowListener(new WindowAdapter() {
         public void windowClosing (WindowEvent e) { System.exit(0); }
    frame.pack ();
         frame.setVisible(true);
    //MyActionListener myListener= new MyActionListener();
    b1.addActionListener(new MyActionListener());
    b2.addActionListener(new MyActionListener());
    b3.addActionListener(new MyActionListener());
    //sampleJList.addActionListener(new MyActionListener());
    }//main
    private static void add_name(String f_name, String l_name)
    listM.addElement(l_name+ ", " + f_name);
    }//method add_fname
    private static DefaultListModel return_fname()
    return listM;
    }//method return_fname

    Ok! This is the LONG answer, but I think you would benefit from reading it all.
    Making something public means that it can be accessed from other classes; however, it must be accessed using an object(instance) of that class. This means, if I have a class MyJFrame that extends JFrame, then in another class, I can do this:
    MyJFrame myFrame = new MyJFrame();
    myFrame.dispose();
    myFrame.isShowing = false;
    Given that dispose() is a public method and isShowing is a public boolean variable that's in the MyJFrame object. Note: the opposite of public is private meaning that the variable/function is only accessible within the class. Also, in all my examples, I assume each class has access to the others.(in same Package, or imported)
    There are times at which you do not want to call a function on a given object or you want variables that are defined in the CLASS context, not the OBJECT context. As in, I have the class MyJFrame, and I always want to be able to access every object(instance) of this class that I've created. I would accomplish this using a static variable. Define the variable the same place you would define any other variable of the class, but inclued the reserved word "static". As in:
    public class MyJFrame{
    public static Vector allFrames = new Vector();
    then in my contructor, I would add this frame to the vector:
    public MyFrame(){
    allFrames.add(this);
    Now that I have this set up, I can access all the frames I've made from anywhere using MyJFrame.allFrames (note that I use the CLASS name, and I don't have an instance of the object anywhere)
    Another use of static is for functions. Going along with the same example, I could add a closeAllJFrames function:
    public static void closeAllJFrames(){
    for(int x=0; x<allFrames.size(); x++){
    allFrames.elementAt(x).dispose();
    then I can call this function from any other class using: MyJFrame.closeAllJFrames();
    Also worth noting, this function could be placed in any other class(other than inner classes, which cannot have static functions), you'd just need to put MyJFrame. in front of the allFrames.
    One last tip is: If you use code like I've shown, consider using a Hashtable instead of a Vector if you need to access certain frames(or whatevers) from afar. This will keep you from iterating thru the Vector and will decrease overhead significantly.
    Hope this helps
    --Zephryl

Maybe you are looking for

  • Video Converter + video compatabil

    I have a Zen Vision : M 30Gb and I recently downloaded every possible firmware/application for my player. No problems with my firmware yet, but with an application. My main problem is the video converter: I downloaded via Zencast (the newest) a few f

  • MacBook Pro run very slow when open Contacts

    My MacBook Pro (earlie 2011) run very slow. When open Contacs show the color ball. I can't see duplicates contacs.

  • Debugging EnterPrise Service in Process Instances

    Hi BPM Experts. I'm trying to debug EnterPrise Service on BPM(Process Composer). but, NDWS's debug view is only possible to see Process Context values. I want to check value of service interface of EnterPrise Services, before and after. Please tell m

  • Can I download an earlier version of a desktop application?

    I JUST finished a course learning InDesign 5 and my intention was to join the cloud and download the application so I could get used to it. I have an interview coming up soon and I didn't want to confuse myself with a newer version. I thought I read

  • HELP, about DB_AUTO_COMMIT

    look at the following codes, the compilation can be successful, but when executing it, ret=dbp->put(dbp,txn,&key,&data,0); will return non-zero, if db_flags is db_create|db_auto_commit, the execution can be normal, I do not know why, why can not I se