Swing related question wrongly posted in the JDBC forum

The OP needs some sort of dynamic table model. He does not seem to understand the difference between JDBC and Swing so I am not hopeful for an easy resolution.
The table model used appears to be static so it is not wonder that the new rows are not visible.
I asked the OP to post their questiopn in here several times so far but it seems rather hopeless. Perhaps someone here can help.
http://forum.java.sun.com/thread.jspa?threadID=699957&tstart=0

If you have CC you get Edge and you are free to use it any DPS work you do, including Single Edition.
Bob

Similar Messages

  • Please post documentation-related questions or comments on the

    Please post documentation-related questions or comments on the Performance Management Applications {forum:id=1318} forum     
    http://forums.oracle.com/forums/forum.jspa?forumID=1318

    I just got a call today that I reached my 300GB limit for the month.  I called and got a pretty rude response from the security and data usage department.  The guy told me in so many words that if I do not like or agree with the policy that I should feel free to find another service provider.!!! I tried to explain that we watch Netflix and XFinity on-demand alot and I was told that that can not be anywhere close to the data usage. I checked my router and watching a "super HD, dolby 5.1" TV show on Netflix will average about 5-6 GB per hour (1.6MB/s) ... sp this means that I can only watch no more than 1-2 Super HD TV shows a day via Netflix before I run out of my data usage.    This seems a bit redicilous doesn't it? Maybe the TV ads about the higher speed than the competition should be accompanied with "as long as you don't use it too often"   Not a good experience ... 

  • Why aren't I allowed to post in the iPad Forum?

    I was allowed to post in the iPhone forum but now I'm told that I'm not allowed to post in the iPad forum! What is going on here?
    EDIT.
    Disregard; I went back and tried for the 5th or 6th time and it seems to have posted. Jive software must being acting up again!

    The forum likes to log me out for no reason just before replying to posts...I'm logged in, I click on the reply button, then BAM! I'm logged out. Happens many times in a row as well within the same session. It's quite maddening.
    This could be what's happening with the OP.

  • How do you answer a post on the old forums?

    I see there are many new posts on the old forum.
    When clicking reply, it takes me to the new forum.
    I expect this means that the old posts are now read-only and will not be
    migrated to the new forum?
    A great deal of time went into posting in the old forum by everyone.
    Has this work been lost now?

    DavidBedford wrote:
    Has this work been lost now?
    It is read only until the 26 February.
    Any threads that were e-mailed to the mods before 6 January 'might' make onto here.
    I asked about any threads created after 6 January (on the old forum) and didn't get a reply in time
    -+-No longer a forum member-+-

  • How do you find what you posted to the support forum?

    Last night I posted a question about Firefox being unable to load certain https URLs, but now I can't find it. I would like to be able to find it to see if anyone has made any helpful replies. In the forum settings, I have the following checkboxes:
    Watch forum threads I start:
    Watch forum threads I comment in:
    Watch KB discussion threads I start:
    Watch KB discussion threads I comment in:
    Send emails for private messages:
    All of the above settings are checked, but I can't find where in the interface for these forums I should go to view the threads and comments that I am "watching."
    I will bookmark this present support topic so that I can return to it later.
    thank you for any help you can provide!

    ha ha ha oh my god...
    okay, thank you for the help... I see what the problem is... this web site's UI has a shortcoming...
    this URL:
    https://support.mozilla.org/en-US/home
    appears to be the home page of the forums... but it is not....
    the home page of the forums is buried in a link off to the side in a list labeled "For Contributors"... I mean... by seeking help in the forums, I'm now a "contributor"? ehhh... English... It'd be nice if the UI designers would use it...
    the home page to the forums is found via this URL:
    https://support.mozilla.org/en-US/questions
    See... whoever named that URL had the right idea... instead of
    https://support.mozilla.org/en-US/contributors , the person used:
    https://support.mozilla.org/en-US/questions
    hmmm.... now if the heading on the right said:
    "For people with questions"
    then I would have scanned it more closely, and I would have noticed "Support Forum Home" in the list.
    I think the fact that so many people use Firefox is really a testament to how bad the other software out there really is, not to how good the Firefox stuff is or how responsive the firefox people are... E.g. is anyone going to actually learn from my above experience, and make the support forums easier to find?
    Is anyone going to actually put a link to the forums in the dashboard for the account that is used to log into the forums?
    No, not a chance...
    I mean, yes, I get that the link to the forums home page is always in the footer at the right, but come on, for crying out loud... so are stupid advertisements... it's a footer or side bar or whatever you want to call it... people are trained on a subconscious level, by now, to ignore that crap. If you were going to design a forum, would you take the most important links, and put them off to the side, where they are less likely to be noticed?
    This is what I see when I bring up my dashboard:
    https://support.mozilla.org/en-US/user/630258
    I mean, if you are a small time developer, with a few thousand users, you probably don't have the time or the resources to make something that's optimal... but when you have millions upon millions of users... optimizing your interface might be worth looking into.... you know... auditing the performance and effectiveness of your UI now and again might be a good idea... You take the few minutes that you waste a user with a confusing counter-intuitive non-standards-based interface, and you multiply that by millions of users, and what can I say... that's a *lot* of waste.
    You don't even have an index of forum content... everything is found by searching... Imagine if you walked into a library, and they had NO catalog.. Instead, all books just tossed into a database, and the only way to find anything is by searching. That would be... just incredibly stupid.... That is what this forum interface is.

  • Some of my posts on the Portege forum don't appear

    I've posted regarding the use of face recognition on the new R600, which we have just received. However, my posts on that topic have not appeared in the forum.
    Why?

    Hello
    If you cannot find your posting in category you wrote maybe moderator removed it into other category. Best example is your posting about face recognition tool. This tools is not on Portege notebooks only and it is good to have it in the right category.
    Are you agreeing with me?

  • Can someone answer this post in the Mac forum?

    b noir or Pac or anyone?
    http://discussions.apple.com/thread.jspa?threadID=696413&tstart=0
    M

    Good catch, I replied too it. Usually when I see post and it says they have a mac I just reply...
    "This is itunes for windows, if your doing this on a mac you need to post in the itunes for mac forum for better help"
    I do that because sometimes even tho it says mac there doing it on there PC or a friends PC.

  • Communication between sibling webapps? ( also posted to the jsp forum )

    Hi Folks,
    I'm working with a web application ( with multiple webapps ) in which some requests to some of the webapps ( call them A, because they are all similar ( one for each of our clients ), but may have their own ( possible multiple )specific implementations of an interface that is available across the application ) are handled ( via a RequestDispatcher include( request, response ) ) by a servlet in another webapp ( I'll call it B ), that provides some specialized services ( and receives the Request it is working on ). The include is part of an custom jsp tag, which is used on some of an A's pages, and which always includes from B.
    B's service may need an instance of one of those A-specific implementations, but the service doesn't know whether that is the case, or which specific implementation class to use until it receives the request. The problem is that if the .class file is in A's WEB-INF ( classes or lib ), if B's code uses Class.forName ( or similar ) it can't see the class, because its ClassLoader is a sibling of A's, and not a parent.
    This has been dealt with so far dealt by putting ALL of the implementation classes in B's WEB-INF, but that is ugly, crowded, and confusing ( and possibly risky - a typo in a configuration file could have A1 using an A2 implementation ). So, it would be better to move the implementations to the appropriate A's WEB-INF.
    The question is, what is the best/recommended/cleanest/least-risky ( multiple answers accepted ) way of letting B's service get the specific implementation it needs.
    So far the possibilities that I've heard are ( in no particular order ):
    ---- 1 ----
    a. Have the tag instance get the ClassLoader of the page the tag was on, and add it as an attribute to the request.
    b. The service looks up ( from configuration ) the classname it has determined it needs, as it does currently.
    c. Have the service get the ClassLoader from the attribute, and use it with something like Class.forName( String, boolean, ClassLoader ) to instantiate the implementation it needs, and use it.
    ---- 2 ----
    a. Like 1, except that the tag passes an instance of some factory that was loaded by A's classloader, that will be able to load the implementation whose .class file is in A.
    ---- 3 ----
    a. Have the tag try to determine the implementation that will be needed, instantiate it, and pass it along as in 1 or 2. ( and WHEN it will be needed - the service isn't used on all paths through the tag, though that is also the case for 1 & 2, but there the attribute value can be the same instance each time, while in this case, we probably need a new instance of the implementation )
    ---- 4 ----
    a. Do something else ( please fill in the blank )
    Any suggestions will be greatly appreciated - as well as comments on the issues that might be involved with each possibility.
    ( I apologize for the over use of parentheses, but that's the way I think - early LISP influence )
    Thanks,
    George McKinney

    Most web application servers have a means of sharing common libraries between web applications. In Tomcat you can put the common libraries in the common or shared directory. In Weblogic you can bundle the war files in an ear file and put the APP_INF directory of the ear file. Consult the documentation for your web application server for how it's classloading works.

  • Copyright question for posting to the web

    hi all.
    i am wondering if someone wouldn't mind giving me a bit of expertise on a question i have.
    i have a set of images from various sources that are basically creative imagery. i have organized these and i would like to share them by posting them to an album on my flickr account.
    i have named the files with the topic and the photographer and i am wondering if it is likely to create a problem. in /most/ cases these images are actually from the New York Times so the file name says "architecture house_ray jones NYT.png" or whatever.
    is there a hard rule against this? is it possible to give attribution in the photo explanation and be OK?
    thanks for any advice.

    You'd have to contact the copyright holder to find out what you can do with the images.
    from the NYT website:
    2. CONTENT ON THE SERVICES
    2.1 The contents of the Services, including the Site, are intended for your personal, noncommercial use. All materials published on the Services (including, but not limited to news articles, photographs, images, illustrations, audio clips and video clips, also known as the "Content") are protected by copyright, and owned or controlled by The New York Times Company or the party credited as the provider of the Content. You shall abide by all additional copyright notices, information, or restrictions contained in any Content accessed through the Service.
    2.2 The Services and Contents are protected by copyright pursuant to U.S. and international copyright laws. You may not modify, publish, transmit, participate in the transfer or sale of, reproduce (except as provided in Section 2.3 of these Terms of Service), create new works from, distribute, perform, display, or in any way exploit, any of the Content or the Services (including software) in whole or in part.

  • Obtaining Tomcat Version (also posted on the JSP forum)

    Hi,
    Sorry to be double posting - I don't usually but this is kind of important and I thought perhaps some of you java gurus could help out.
    I am creating an installation program that searches the disk for tomcat server. Once I have found the tomcat.exe program I am assuming tomcat is properly installed.
    What I need to do next is get the program version. Are there any features offered by Java that do just this ?
    Thanks for reading, I would be glad for any help...
    BadLands

    Thanks SaturnBlues,
    I had also thought about looking at the server.xml file which contains the version - but say my app should be compatible with later versions of tomcat - I shall be in a rut if they change the naming conventions...and so on.
    I was thinking more in the lines of getting hold of the version through the properties or something (you know - when you right click under windows and you get the version tab...).
    But I don't have a clue what java offers down these lines.
    BadLands

  • Advanced Analysis question..is this the right forum?

    I recently installed advanced analysis on my Pc running Win7 and Office 2010.  I receive an error after refresh which terminates my application.  Can anyone tell me if they have seen an eoor like this before?
    Picture--> 
    http://i.imgur.com/B2Mhi.jpg
    I have the latest patch for BI and AA.

    Hi,
    Can you please confirm that you have Note 1487207 applied?
    Regards,
    Michael

  • Please only post SAP Business Objects products related questions here

    Hi
    Thanks for reading.
    Unfortunately many people get confused with the term BI which was used for SAP BW at one time. With the acquisition of Business Objects some product names have changed.
    SAP BW is still SAP BW, please post in the respective forums: /community [original link is broken]
    Business Intelligence in this forum refers to the these SAP Business Objects products:
    SAP Business Objects Enterprise
    SAP Business Objects 4.0
    SAP Business Objects Intelligence Platform 4.0
    For more information and great articles and videos please see:
    http://www.sdn.sap.com/irj/boc/bi
    Kind Regards
    Roland Hoeller

    >
    Suresh Babu Aluri wrote:
    > Hi,
    >
    > You can create All prompt in lovs of reuired object as
    >
    > do the following steps for all prompt creation.
    >
    > 1. Go to Object to which the lovs are mapped. -> select object -> properties -> advanced (not sure) -> edit lovs -> then a query panel will display and it will have query like
    >
    > select distinct(..........) from ......................
    >
    > change the above query to
    >
    > select distinct(..........) from ......................
    > union
    > select 'all' from dual -> dual is temporary table in oracle (you define a temporary table w.r.to database)
    >
    > 2. In designer go to the object on which prompt is defined.
    > i.e.
    >
    > may be in selecor where clause you might defined prompt as
    >
    > .............. @prompt('Member Name')
    >
    > so change that to
    >
    > .................. .............. @prompt('..Member name')
    > or
    > 'all' in @prompt('Member name')
    >
    > 2. For your second requirement the max no lov values are changed in prm files. For that go to programs -> BO -> BO ii.5 or ur version -> dataaccess->win32_x86-> based on ur back end select required folder -> search in *.prm files to change the max no lovs.
    >
    > Cheers,
    > Suresh Aluri.
    Hi Suresh
    Thank you for the detailed response.  I tried your suggestions and neither works.
    LOV issue:
    Within the Business View manager, i right-click on the LOV object and click "Edit List of Values..." and i get a dialog box that only shows me Available fields, List of Value Fields used, description field, and Referenced objects. Along with buttons for Clear Instance & Refersh Status.
    I have read similar posts to what you suggested but never get to the same place as described.
    Please advise....
    as for _Max Number LOV _
    I have researched this as well and found the same suggestion you made. But the PRM file does not have that value, and the file contains all XML code
    Now what???
    Thanks
    Mike

  • Please Guys this is the OO Forum not General Abap QUESTIONS.

    Hi everyone
    This is the OO Forum. There's often stuff here which really has nothing to do with OO.
    <b>For example the question on Table Controls and BDC -- sorry poster of that topic I'm not trying to have a go at you but defintely the wrong forum for that post.
    There's another post at hiding source code.
    This also has NOTHING WHATSOEVER to do with OO  / ABAP objects.</b>
    I think for people who want answers to their questions whether OO related or not will probably get  a much better response if they post to the correct Forum.
    Posting totally non OO related stuff to this Forum not only reduces the usefulness of this Forum to people who genuinely are looking for OO information / answers but also makes it difficult for people to answer your "non OO" question as they are unlikely to be reading this forum.
    I'm not trying to be too difficult here but keeping most posts On Topic makes the Forum far more useful to everyone genuinely interested in OO .
    Cheers
    Jimbo

    $299 for the 16GB White which is what I have and as for contracts it is true must buy a contract. now i have heard of people buying the contract and phone then paying the $200 surcharg to end contract then user void phone by cracking it and go through some other companies this is HIGHLEY not advise considering APPLE will not touch your phone once you do so. your running a HIGH risk of errors and I dont even think iTunes will recognize it will it?. and tamara up there $1680 for contract fees *** is that i walked out of store with 16GB White and service for only $389 and first bill with activation charges was only $175, although i do think it is somewhat chincy that you wasnt text need seperate plan phone calls? also need seperate plan. bringing your average mo. price to around $100. **** my WORK phone is only 60 bux a month and has WAY more talk time and texting emails and datat than iPhone Service. I love iPhones safari though. very solid.

  • Is it the OS or the JVM or the JDBC Driver

    Hello All,
    I have about 25 different databases I want hit with the application depending on who the user is. I am using DriverManager.getConnection or Datasource.getConnection to obtain connection to the database.
    It is not connection pool so all the connections and datasources are configured with in the application.
    The problem I am facing is I cannot connect to some of the Databases at certain time and is always random, and If I try to run it as a stand alone Java application, I can connect to the data base fine.
    So after doing much research and calling IBM, in order to recreate the problem, I tried to run a simple java program in a loop , see if I can connect all of them on work station. There also I ran into the same issue. Connecting to database was really random. After looking at the JDBC debug output and every thing, I found an intersting issue.
    When the JDBC connects to the database on my workstation, i don't see the netstat activity to that database. If I just run the program for that one database, I can connect oaky.
    I tried everything, allowing TCP to have more ports, connection time outs, I also used the IP's instead of host names to avoid nslookup issues. Synchronizing the method that connects to database, nothing seem to improve my chances
    Is it JVM related or Operating system or the JDBC, I couldn't tell. I tried using lot of Memory just to make sure it is not GC or resource issue, without any chance
    Anyone with input is much appreciated.
    I appreciate your help in advance.

    All the Databases are of type Informix.
    Probably I picked wrong words when I said stand alone. I am actually using in servlet where I am facing the problem. To be precise when I tried to recreate the problem , all I did is I created a java program which connects to all the database one at a time in a loop and does a simple query and exists out, and closes everything.
    I have another program which just runs for only one database.
    So If I take the database which fails in the loop and run it on the other one it just connects fine and everything.
    About the connection issue all I have is just one connection per database, after I am done, I just close it and the connection to database is attempted.
    Following is the program which runs through all the databases, I have changed few things to post it on the forum.
    public class InformixAll {
         volatile static IfxDataSource ds;
         public static void main(String[] args) {
              String[] dbArray =
                        "1.1.1.1",
                        "1.1.1.1",
                        "1.1.1.1",
                        "1.1.1.1",
                        "1.1.1.1",
                        "1.1.1.1",
                        "1.1.1.1",
                        "1.1.1.1",
                        "1.1.1.1",
                        "1.1.1.1",
              try {
                   ds = new IfxDataSource();
              } catch (SQLException e1) {
                   e1.printStackTrace();
              for (int i = 0; i < dbArray.length; i++) {               
                   doIt(dbArray, i);
         public synchronized static void doIt(String dbArray, int i) {
                                  String ip = null;
                   try {
                             Process p = Runtime.getRuntime().exec("nslookup " + dbArray);
                             BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
                             String k = null;
                             while ((k = reader.readLine()) != null) {
                                  if(k.indexOf(dbArray) > 1)
                                  {k = reader.readLine();
                                       System.out.println(k);
                                       ip =k.trim();
                        } catch (Exception e) {
                             e.printStackTrace();
                   try {
                        ds.setDatabaseName("SOME DB");
                        ds.setServerName("DEMO");
                        ds.setPortNumber(100);
                        ds.setUser("USER");
                        ds.setPassword("PASS");
                        ds.setIfxIFXHOST(ip);
                        ds.setIfxIFX_ISOLATION_LEVEL("1");
                        ds.setIfxINFORMIXCONRETRY(50);
                        ds.setIfxINFORMIXCONTIME(3);
                        ds.setIfxTRACE(3);
                        ds.setIfxTRACEFILE("c:\\temp\\isptrace.txt");
                        ds.setIfxPROTOCOLTRACE(2);
                        ds.setIfxPROTOCOLTRACEFILE("c:\\temp\\prot.txt");
                        ds.setIfxIFX_AUTOFREE(true);
                        ds.setIfxOPTOFC("1");
                        ds.setIfxIFX_ISOLATION_LEVEL("1");
                        Connection c = ds.getConnection();
                        PreparedStatement st = c.prepareStatement(" SELECT * FROM TABLE ");
                        ResultSet rs = st.executeQuery();
                        System.out.print(i + "." + " Number " + dbArray + " = ");
                        if (rs.next()) {
                             System.out.print(" OKAY ");
                        } else {
                             System.out.print(" OKAY ");
                        System.out.println();
                        rs.close();
                        st.close();
                        c.close();
                   } catch (SQLException e) {
                        System.out.println("Could not Connect to " + dbArray);

  • Details for last question I post

    the original code for last question I post(about the DataInputStream& EOFException) is here, thanks if anyone will bother to read it
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.* ;
    public class MasterMindServer
         public MasterMindServer()
              try{
                   ServerSocket serverSocket=new ServerSocket(8000);
                   Socket socket=serverSocket.accept();
                   HandleAClient thread=new HandleAClient(socket);
                   thread.start();
                   }catch(IOException e){System.out.println("Error:"+e.toString());}
         public static void main(String args[])
              new MasterMindServer();
    //inner class
    class HandleAClient extends Thread
         DataOutputStream out;
         DataInputStream in;
         BufferedReader fromFile;
         private Socket socket;
         String line;
         public HandleAClient(Socket socket)
              this.socket=socket;
         public void run()
              int x,o;
              try{
                     out=new DataOutputStream(socket.getOutputStream());
                   in=new DataInputStream(socket.getInputStream());
                   fromFile=new BufferedReader(new FileReader("colorcode.txt"));
                  while((line=fromFile.readLine())!=null)
                    for(int i=0;i<10;i++)
                      String t=in.readUTF();
                      x=check_column(t);
                       System.out.println(x);
                       o=check_color(t);
                       System.out.println(o);
                       out.writeInt(x);
                       out.writeInt(o);
                       if(x==6) break;
                     out.writeUTF(line);
                   socket.close();
                   System.out.println("close");
             }catch(IOException e){
             System.out.println("Error:"+e.toString());}
         public int check_column(String s)
              String str;
              str=s;
              int count=0;
              for(int i=0;i<6;i++)
                   if(s.charAt(i)==line.charAt(i))
                   count++;
              return count;
         public int check_color(String s)
              String str;
              str=s;
              int count=0;
              for(int i=0;i<6;i++)
                   if((line.indexOf(s.charAt(i))!=-1)&&(line.charAt(i)!=s.charAt(i)))
                   count++;
              return count;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.* ;
    public class MasterMindClient extends JFrame implements MouseListener,ActionListener
      /** Default constructor */
      //keep track of the row (or trial) and column number
      int trial_num, col_now ;
      Socket socket;
      int count[]={5,5,5,5,5,5};
    JPanel A[]  = new JPanel[10];
      JPanel B1[] = new JPanel[10];
      JPanel B2[] = new JPanel[10] ;
      JPanel notice = new JPanel() ;
      JPanel sub_notice = new JPanel();
      JPanel D1, D2 ;
      static JTextField [][]color = new JTextField[10][6] ;
      static JTextField [][]Output = new JTextField[10][2];
      static JTextField [][]Answer = new JTextField[1][6] ;
      static JButton []ok = new JButton[10];  
      JLabel L1 = new JLabel("Click the textfield to change color");
      JLabel L2 , L3, L4 ;
      String colorRange="BCGRYW";
      Color colorName[]={Color.black,Color.cyan,Color.green,Color.red,Color.yellow,Color.white};
      String temp ;
    public MasterMindClient() {
        // initialize
        trial_num = 0;
        col_now = 0;
        //sub_notice is Panel where the heading labels are placed
        sub_notice.setLayout(new GridLayout(1,3)) ;
        L2 = new JLabel("  ") ;
        L3 = new JLabel("X");
        L3.setHorizontalAlignment(JTextField.CENTER);
        L4 = new JLabel("O");
        L4.setHorizontalAlignment(JTextField.CENTER);
        L3.setToolTipText("matching color and column");
        L4.setToolTipText("matching color but not matching column" );
        sub_notice.add(L2);
        sub_notice.add(L3);
        sub_notice.add(L4);
        notice.setLayout(new GridLayout(1,2)) ;
        notice.add(L1) ;
        notice.add(sub_notice) ;
        // Get the content pane of the frame
        Container c = getContentPane();
        // Set GridLayout, 4 rows, 3 columns, and gaps 5 between
        // components horizontally and vertically
        c.setLayout(new GridLayout(12, 1, 5, 5));
        c.add(notice);
         JPanel Display = new JPanel() ;
         Display.setLayout(new GridLayout(1,2,5,5)) ;
       //create a Panel for each row to accept use input
       // color[][] textfield is where the user input
       // Output[][] is where to display the number of X and O
        for (int i = 0; i <= A.length-1 ; i++)
        A[i] = new JPanel() ;
        A.setLayout(new GridLayout(1, 2,10,10));
    B1[i] = new JPanel();
    B1[i].setLayout(new GridLayout(1,6,5,5)) ;
    B2[i] = new JPanel();
    B2[i].setLayout(new GridLayout(1,3,5,5)) ;
    for (int j = 0; j <= color[i].length-1 ; j++)
    color[i][j] = new JTextField() ;
    color[i][j].setHorizontalAlignment(JTextField.CENTER);
    if (i == 0)
    {color[i][j].setEditable(true) ;
    else
    {color[i][j].setEditable(false);
    color[i][j].addMouseListener(this);
    B1[i].add(color[i][j]) ;
    } // j loop
    ok[i] = new JButton("SEND");
    if(i==0)
         ok[i].setEnabled(true);
    else
         ok[i].setEnabled(false);
    ok[i].addActionListener(this);
    B2[i].add(ok[i]) ;
    Output[i][0] = new JTextField();
    Output[i][1] = new JTextField();
    Output[i][0].setEditable(false);
    Output[i][1].setEditable(false);
    Output[i][0].setHorizontalAlignment(JTextField.CENTER);
    Output[i][1].setHorizontalAlignment(JTextField.CENTER);
    B2[i].add(Output[i][0]);
    B2[i].add(Output[i][1]);
    A[i].add(B1[i]);
    A[i].add(B2[i]) ;
    c.add(A[i]) ;
    } //for i loop
    //D panel is where we store the answer[][]
    D1 = new JPanel();
    D1.setLayout(new GridLayout(1,6)) ;
    D2 = new JPanel();
    D2.setLayout(new GridLayout(1,2)) ;
    for (int j = 0; j <= Answer[0].length-1 ; j++)
    Answer[0][j] = new JTextField(0) ;
    Answer[0][j].setHorizontalAlignment(JTextField.CENTER);
    Answer[0][j].setEditable(false) ;
    D1.add(Answer[0][j]) ;
    Display.add(D1) ;
    Display.add(D2) ;
    c.add(Display) ;
    public void runClient()
         try
    {      socket=new Socket("localhost",8000);
    DataInputStream in=new DataInputStream(socket.getInputStream());
    int x=0;
    int o=0;
    try{
    while(true)
         while(trial_num<10)
              x=in.readInt();
              //System.out.println(x);
              Output[trial_num][0].setText(String.valueOf(x));
              o=in.readInt();
              //System.out.println(o);
              Output[trial_num][1].setText(String.valueOf(o));
              for(int i=0;i<6;i++)
              color[trial_num][i].setEnabled(false);
         ok[trial_num].setEnabled(false);
         trial_num++;
         col_now=0;
         if(x==6)
                   JOptionPane.showMessageDialog( null, "Congratulation, you've won the game !! " );
                   //ok[trial_num].setEnabled(false);
    break;
         if(trial_num<10)
         {  for(int i=0;i<6;i++)
              color[trial_num][i].setEditable(true);
              count[i]=5;
         ok[trial_num].setEnabled(true);
         if(x!=6)
         {  JOptionPane.showMessageDialog( null, "sorry you did not win the game");
         temp=in.readUTF();
         System.out.println(temp);
         //temp=in.readUTF();
         //System.out.println("can");
         for(int i=0;i<6;i++)
         System.out.println(i);
         char a=temp.charAt(i);
         int index=colorRange.indexOf(String.valueOf(a));
         Answer[0][i].setBackground(colorName[index]);
         trial_num=0;
         for(int j=0;j<10;j++)
         for(int k=0;k<6;k++)
         color[j][k].setBackground(Color.white);
         for(int j=0;j<10;j++)
         for(int k=0;k<2;k++)
         Output[j][k].setText(null);
         for(int i=0;i<6;i++)
              color[trial_num][i].setEditable(true);
              count[i]=5;
         ok[0].setEnabled(true);
         catch(EOFException em){}
         }catch(IOException ex){
              System.out.println("Error:"+ex.toString());}
    public void mouseClicked(MouseEvent e)
    for(int i=0;i<6;i++)
         if(e.getComponent()==color[trial_num][i])
         {         col_now=i;
         break;
    count[col_now]=(count[col_now]+1)%6;
    color[trial_num][col_now].setBackground(colorName[count[col_now]]);
    public void mouseEntered(MouseEvent e)
    public void mouseExited(MouseEvent e)
    public void mouseReleased(MouseEvent e)
    public void mousePressed(MouseEvent e)
    public void actionPerformed(ActionEvent e)
         try{
              send();
         }catch(IOException et){System.out.println("Error:"+et);}
    public void send()throws IOException
         DataOutputStream out=new DataOutputStream(socket.getOutputStream());
         char cbuf[]=new char[6];
         for(int i=0;i<6;i++)
              cbuf[i]=colorRange.charAt(count[i]);
    System.out.println(cbuf);
         out.writeUTF(new String(cbuf));
    /** Main method */
    public static void main(String[] args) {
    MasterMindClient frame = new MasterMindClient();
    frame.setTitle("Master Mind");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setLocation(300,300) ;
    frame.setSize(450, 450);
    frame.setVisible(true);
    frame.runClient();
    } // end of class

    I notice that you have several hundred lines of GUI code there. None of them have anything to do with the problem you are trying to solve. So put them all aside and write a SMALL test program that does nothing but the little loop you are having a problem with. Shouldn't be more than 20 lines of code.

Maybe you are looking for

  • Black rectangle follows cursor

    I just updated to 10.4.8 and when the computer restarted I now have a black rectangle that is centered on my cursor and follows the cursor around the screen. It is just the black outline of a rectangle. Any ideas?

  • Inconsistent Aspect Radio upon Export

    Good Morning, I'm having trouble keeping my aspect ratios clean when I export my project to a file. My project settings are: Editing Mode HD 1080i Frame Size- 1920 x 1080 (16:9) In making the movies, I tend to do a lot of zooming on stills as well as

  • Migrating one email domain to external server

    our AD domain "domain1.com" users have @domain1.com, @domain2.com, and @domain3.com (this one is for testing usage) mailboxes/addresses on our internal Exchange 2010 14.01.0438.000 server.   All users are on the same domain regardless of the email ad

  • PO workflow maintenance

    Hi all, I have currently changing the workflow settings for "Position" using transaction PPOME. Under "Position" folder, there are many defined positions, each with users assigned. Need advises to perform the followings as i am new to workflow mainte

  • Nikon D70 NEF in Camera Raw 4.2

    Hi there, I'm new to the forum. I have two questions. I have searched the User Forum and Adobe site in general in hopes of finding answers, but could not. First question. Is Nikon D70 NEF compatible with Camera Raw 4.2? Second question. When I open m