blackcompe's Profile User Rating: *****

Reputation: 1148 Grandmaster
Group:
Mentors
Active Posts:
2,547 (0.76 per day)
Joined:
05-May 05
Profile Views:
37,715
Last Active:
User is offline Today, 10:27 AM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
Playstation
Your Car:
Who Cares
Dream Kudos:
150
Expert In:
Java

Latest Visitors

Icon   blackcompe Chillish

Posts I've Made

  1. In Topic: Trying to compare two JComboBox'

    Posted 24 Jul 2014

    Ok, well you have the items from each box that are selected. Check if they're the ones you want.

    Spoiler


    You could do it that way or use indices.

    Spoiler
  2. In Topic: Trying to compare two JComboBox'

    Posted 24 Jul 2014

    If you're talking to me, what you have is not what I wrote, so I don't expect it to work.
  3. In Topic: Communication between two web applications

    Posted 24 Jul 2014

    I would suggest starting simple, but as an aside a web server should be able to handle many (~100 to 1000) requests per seconds. That's simple requests. Even if you're pulling from a DB via a application server, it should be able to handle a reasonable amount.

    I see your point though. Multi-threading requests to the same port is probably not going to be as beneficial as requests to different ports/urls.
  4. In Topic: Communication between two web applications

    Posted 24 Jul 2014

    To the same domain or URL? Are you providing different POST parameters for each request (if at all)? Why would you request the same data several times? I'll assume the data is different with each request.

    Whether threading will speed things up is something I can't help you with. Too many unknowns. There are plenty of articles/forum posts online that address that issue. Why not write a test and see? If you had a high-volume application, then it would probably help. I suggest starting simple though.
  5. In Topic: Trying to compare two JComboBox'

    Posted 23 Jul 2014

    In addition to what AGENT_P6 said, which I think is the source of your error, you can simply cast the result of getSelectedItem() directly to a String, if that's the data type of the objects stored in the combobox. Furthermore, there's no need to use getSource() if you know what widget the event was triggered by. You usually see that method called when the same listener is attached to multiple widgets.

    JComboBox<String> box1 = init();
    JComboBox<String> box2 = init();
    box1.addActionListener(new ActionListener()
    {
         public void actionPerformed(ActionEvent e)
         {
              String s1 = (String)box1.getSelectedItem();
              String s2 = (String)box2.getSelectedItem();
              if(s1.equals(s2))
                   System.out.println("Hoorah");
         }
    });
    
    

My Information

Member Title:
D.I.C Lover
Age:
Age Unknown
Birthday:
August 22
Gender:
Interests:
Programming, PC Hardware, Cars, Running, Basketball, Weight lifting, Good Music, Video Games
Years Programming:
7
Programming Languages:
Java, C\C++, HTML, SQL, MIPS Assembly, PHP, Javascript, Octave, Ruby, Java EE, Eclipse, CodeBlocks

Contact Information

E-mail:
Private
Website URL:
Website URL  http://

Comments

Page 1 of 1
  1. Photo

    jon.kiparsky Icon

    11 Jul 2013 - 07:32
    Hey, good to see you again. Hope you've been well.
  2. Photo

    WolverineX Icon

    13 Nov 2012 - 12:20
    Cool!
  3. Photo

    vbabey Icon

    14 Aug 2012 - 21:21
    Thank you for your advice on file handling question I asked...
  4. Photo

    karniv0re Icon

    14 Apr 2012 - 21:24
    thanks man, if it wasn't for you pointing out that line in the exception message, i might have been stuck forever!!
  5. Photo

    smohd Icon

    31 Jan 2012 - 04:00
    Congratulation for the promotion, well deserved :)
  6. Photo

    jon.kiparsky Icon

    27 Dec 2011 - 08:26
    I've been meaning to say - good stuff in the Java forum. You know your stuff and you tell it well. It's a pleasure to read - keep it up.
  7. Photo

    anonymous26 Icon

    01 Oct 2011 - 12:46
    Excellent! :)
  8. Photo

    anonymous26 Icon

    28 Sep 2011 - 12:59
    Wow! We have the same birth date! Congrats on the Expert badge. :)
Page 1 of 1