[Date Prev][Date Next][Index][Thread]
[SGT Mail Archive]
[SGT Main Page]
Re: sgt question
*************************************************
Message from the sgt mail list.
*************************************************
The problem your experiencing is most likely due to the behavior of the
BorderLayout manager. The JTimeSeriesDemo is already using the
BorderLayout.CENTER position and if you add another JPane to the same
position the first becomes undefined. To put two plots, side by side or
one over the other, will require you either use another Container, like
JPanel, and put both panes on that using, for example, GridLayout. Then
adding the new JPanel to the JFrame.
JPanel plots = new JPanel();
plots.setLayout(new GridLayout(2,1)); // 2 rows, 1 column
plots.add(pane_);
JPane secondPane;
secondPane = makeGraph();
plots.add(secondPane);
getContentPane().add(plots, BorderLayout.CENTER);
I hope this helps.
Don
At 10:35 AM 7/20/2001 -0400, Michael P Duff wrote:
>*************************************************
>Message from the sgt mail list.
>*************************************************
>
>Hi
>
>I'm developing an applet, based on your JTimeSeriesDemo, to view my
>timeseries data. I based my code on the source of the demo. The problem I
>have is when I try to replace the original plot with a second. When I
>launch the applet, my graph shows up perfectly. However, when I make a new
>graph and add it , I have problems. I get a either a white square or a
>"mini-plot" in the upper left corner of the window. I've tried to draw and
>repaint, nothing seems to work. I can remove the first plot with the
>remove method, but I then get a white square in the upper left corner over
>a gray background. I've duplicated the problem by adding these three
>lines to the end of the public void init() { in JTimeSeriesDemo.java:
> JPane secondPane;
> secondPane = makeGraph();
> getContentPane().add(secondPane, BorderLayout.CENTER);
>
>I would appreciate any help you can give me.
>
>Thanks
>
>Mike
>
>
>
>*************************************************
>To remove yourself from this mailing list,
>send mail to <Majordomo@epic.noaa.gov> with
>"unsubscribe sgt" in the message body.
==================================================
Donald W. Denbo dwd@pmel.noaa.gov
Ph: (206) 526-4487 Fax: (206) 526-6744
Collaborative tools: http://www.epic.noaa.gov/collab/
Netcdf Browser: http://www.epic.noaa.gov/java/ncBrowse
Scientific Java Graphics: http://www.epic.noaa.gov/java/sgt
EPIC Oceangraphic Data Management: http://www.pmel.noaa.gov/epic
==================================================
*************************************************
To remove yourself from this mailing list,
send mail to <Majordomo@epic.noaa.gov> with
"unsubscribe sgt" in the message body.