Results 1 to 7 of 7
  1. #1
    baran_khan is offline Member
    Join Date
    Aug 2008
    Posts
    6
    Rep Power
    0

    Default JTextField in a JPopupMenu

    I am trying to push swing elements in a JPopupMenu object, the issue is that I cannot access my JtextField element. For some reason it remains disabled and I cannot change the content of it. Rest of the elements are working fine. Below is the code that create the elements which I am adding in my pop up menu.
    PHP Code:
    public class FilterBoxGenerator implements ActionListener{
        Map<String, Pattern> m;
        private Box filterBox;
        public JRadioButton exactMatch, contain;
        public ButtonGroup bGroup;
        public JTextField patternText;
        public JPanel panel;
        JFrame frm;
        public FilterBoxGenerator(){
            m = new HashMap<String, Pattern>();
            bGroup = new ButtonGroup();
            filterBox = Box.createVerticalBox();
            exactMatch = new JRadioButton("Exact Match");
            exactMatch.addActionListener(this);
            patternText = new JTextField("Enter Text");
            patternText.setEditable(true);
            panel = new JPanel();
            patternText.setEnabled(true);
            panel.add(patternText);
            patternText.setText("quick brown");
            filterBox.add(panel);
            contain = new JRadioButton("Contains");
            contain.addActionListener(this);
            bGroup.add(exactMatch);
            bGroup.add(contain);
            filterBox.add(exactMatch);
            filterBox.add(contain);
        }
     
        @Override
        public void actionPerformed(ActionEvent e) {
            System.out.println("Clicked"+e.getActionCommand());
            System.out.println(e.toString());
            if(e.getActionCommand().equals(exactMatch)){
                System.out.println("Baran");
            }
            
        }
        public Box getFilterBox() {
            return filterBox;
        }
    }

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default

    Just another cross poster.
    Swing - JTextField in a JPopupMenu

    db

  3. #3
    baran_khan is offline Member
    Join Date
    Aug 2008
    Posts
    6
    Rep Power
    0

    Default

    I wish we had people who can concentrate on the task in front instead of finding posts on different websites. I am the one seeking answer to my query, Its up to me to post it anywhere I want, u got any issue then close it... you dont like it then keep quite...horrible to see people posting sense less things.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default

    No, I won't keep 'quite' ... nor quiet. Since you obviously don't value the time of persons who might respond to your question, you also don't deserve that anyone spend time trying to help you.

    You apparently believe that there's nothing wrong with cross posting. Then why are you upset when it's pointed out?

    db

  5. #5
    baran_khan is offline Member
    Join Date
    Aug 2008
    Posts
    6
    Rep Power
    0

    Default

    well i am not upset with my posting getting pointed out...the thing is I posted on multiple forums to reach different user bases and you had enough reasons to criticize but not enough time to have a look at the issue...i am not wasting anyones time...if u have time then reply and if not then ignore...thats a verys simple and very professional way of working on a forum....guess you got this "Senior member" tag by finding such cross postings....

    Nothing personal dude ..just annoyed by the behaviour of a senior member who should not have done such a silly thing and should have responded more responsibly.

    dont waste time on replyin to my messages...i know how to ignore people ..lets see if you can do the same.. :)

    take care

  6. #6
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    The polite thing to do is to post on one board, then post links to that post on other boards. Cross-posting like you have done is one of the most selfish and annoying things you can do. People spend time answering the question only to find out that someone already solved it weeks ago.

    Don't cross-post.
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  7. #7
    baran_khan is offline Member
    Join Date
    Aug 2008
    Posts
    6
    Rep Power
    0

    Default

    That is a better way to tell buddy...not actually insulting or behaving the way I got replied..I do understand that and also you can see the number of postings I have done...m pretty new..to this...

    I got no personal reasons with anyone..but I do believe in ethics of talking and behaving...

    cheers...I guess i have forgot about my topic :)

Similar Threads

  1. JMenu to JPopupMenu
    By carderne in forum New To Java
    Replies: 0
    Last Post: 02-28-2009, 07:07 PM
  2. Replies: 1
    Last Post: 01-30-2009, 07:44 PM
  3. JPopupMenu
    By hungleon88 in forum NetBeans
    Replies: 8
    Last Post: 01-15-2009, 06:00 PM
  4. JPopupMenu problem
    By sylvievdb in forum AWT / Swing
    Replies: 3
    Last Post: 10-06-2008, 09:37 AM
  5. JPopupMenu falls behind window
    By undertow in forum AWT / Swing
    Replies: 4
    Last Post: 01-17-2008, 11:20 PM

Posting Permissions

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