Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #24198

Re: Code Included: Freeze column

Newsgroups comp.lang.java.programmer
Date 2013-05-29 23:53 -0700
References <566ff119-faa8-4116-9761-65002a3c1cb3@w8g2000yqf.googlegroups.com> <nospam-D730B4.16293729052013@news.aioe.org>
Message-ID <b838090c-9d8e-48b2-bc22-582f7c61efb4@googlegroups.com> (permalink)
Subject Re: Code Included: Freeze column
From clusardi2k@aol.com

Show all headers | View raw


On Wednesday, May 29, 2013 4:29:37 PM UTC-4, John B. Matthews wrote:
> In article <566ff119-faa8-4116-9761-65002a3c1cb3@w8g2000yqf.googlegroups.com>, Haircuts Are Important <clus@aol.com> wrote: > Basically, I have been unable to get the the 2 tables to scroll > vertically together etc. Your example using a shared model seems to do exactly this. > Second below, if I change the dimension of either JScrollPane it > changes the second one. So, the result is I either get a large left > JScrollPane or a small right JScrollPane. JTable implements Scrollable; you can override the method getPreferredScrollableViewportSize() to make table A narrower: final JTable table = new JTable(model) { @Override public Dimension getPreferredScrollableViewportSize() { Dimension d = super.getPreferredScrollableViewportSize(); return new Dimension(d.width / 2, d.height); } }; > I'd also like to remove any spacing between these 2 tables. The space comes from the default FlowLayout; try this: JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); > Third, I also tried to put each table into a separate JPanel and put > all this into a JScrollPane, but it (appeared to) yield the same > results as the second thing I tried. I don't understand. -- John B. Matthews trashgod at gmail dot com <http://sites.google.com/site/drjohnbmatthews>


>> Basically, I have been unable to get the the 2 tables to scroll 
>> vertically together etc. 

> Your example using a shared model seems to do exactly this.

Yes, but I have to throw away that model in favor of another one because I have to continually add rows to the tables as the project runs. The shared model in the example doesn't allow me to use the "insert" method which is available in another model. 

I.E.: The shared model example populates the tables all at once and not sporadically!

How can I add new rows to the two tables of the shared model example every few minutes and not all at once. 

Thanks  

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Code Included: Freeze column Haircuts Are Important <clusardi2k@aol.com> - 2013-05-29 12:55 -0700
  Re: Code Included: Freeze column "John B. Matthews" <nospam@nospam.invalid> - 2013-05-29 16:29 -0400
    Re: Code Included: Freeze column clusardi2k@aol.com - 2013-05-29 23:53 -0700
      Re: Code Included: Freeze column "John B. Matthews" <nospam@nospam.invalid> - 2013-05-30 21:40 -0400
        Re: Code Included: Freeze column Haircuts Are Important <clusardi2k@aol.com> - 2013-05-31 11:19 -0700
          Re: Code Included: Freeze column "John B. Matthews" <nospam@nospam.invalid> - 2013-05-31 23:59 -0400
            Re: Code Included: Freeze column Haircuts Are Important <clusardi2k@aol.com> - 2013-06-03 10:18 -0700
              Re: Code Included: Freeze column Haircuts Are Important <clusardi2k@aol.com> - 2013-06-03 12:48 -0700
              Re: Code Included: Freeze column "John B. Matthews" <nospam@nospam.invalid> - 2013-06-03 23:03 -0400
                Re: Code Included: Freeze column Haircuts Are Important <clusardi2k@aol.com> - 2013-06-04 05:05 -0700
                Re: Code Included: Freeze column "John B. Matthews" <nospam@nospam.invalid> - 2013-06-04 23:04 -0400
                Re: Code Included: Freeze column Haircuts Are Important <clusardi2k@aol.com> - 2013-06-05 11:53 -0700
                Re: Code Included: Freeze column "John B. Matthews" <nospam@nospam.invalid> - 2013-06-05 16:02 -0400
                Re: Code Included: Freeze column Lew <lewbloch@gmail.com> - 2013-06-05 13:09 -0700
                Re: Code Included: Freeze column clusardi2k@aol.com - 2013-06-05 16:27 -0700
                Re: Code Included: Freeze column Lew <lewbloch@gmail.com> - 2013-06-05 17:35 -0700
                Re: Code Included: Freeze column "John B. Matthews" <nospam@nospam.invalid> - 2013-06-06 21:42 -0400
                Re: Code Included: Freeze column Haircuts Are Important <clusardi2k@aol.com> - 2013-06-10 09:34 -0700
                Re: Code Included: Freeze column "John B. Matthews" <nospam@nospam.invalid> - 2013-06-10 13:49 -0400
                Re: Code Included: Freeze column Lew <lewbloch@gmail.com> - 2013-06-04 12:17 -0700
                Re: Code Included: Freeze column Haircuts Are Important <clusardi2k@aol.com> - 2013-06-04 12:54 -0700
                Re: Code Included: Freeze column Lew <lewbloch@gmail.com> - 2013-06-04 14:17 -0700
                Re: Code Included: Freeze column Joerg Meier <joergmmeier@arcor.de> - 2013-06-05 00:12 +0200
                Re: Code Included: Freeze column "John B. Matthews" <nospam@nospam.invalid> - 2013-06-04 21:39 -0400
                Re: Code Included: Freeze column Lew <lewbloch@gmail.com> - 2013-06-04 19:48 -0700
                Re: Code Included: Freeze column Joerg Meier <joergmmeier@arcor.de> - 2013-06-05 07:36 +0200
                Re: Code Included: Freeze column Lew <lewbloch@gmail.com> - 2013-06-04 22:46 -0700
        Re: Code Included: Freeze column Haircuts Are Important <clusardi2k@aol.com> - 2013-05-31 11:35 -0700
          Re: Code Included: Freeze column Lew <lewbloch@gmail.com> - 2013-05-31 11:43 -0700
            Re: Code Included: Freeze column Haircuts Are Important <clusardi2k@aol.com> - 2013-05-31 11:50 -0700
              Re: Code Included: Freeze column Lew <lewbloch@gmail.com> - 2013-05-31 12:37 -0700
                Re: Code Included: Freeze column Haircuts Are Important <clusardi2k@aol.com> - 2013-05-31 12:44 -0700
          Re: Code Included: Freeze column Haircuts Are Important <clusardi2k@aol.com> - 2013-05-31 12:30 -0700

csiph-web