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


Groups > comp.lang.java.gui > #306

Re: Drawing on Tabs

From "Daniel Dyer" <daniel.dyer@THRWHITE.remove-dii-this>
Subject Re: Drawing on Tabs
Message-ID <op.tjyebjff8kxvgr@jack.local> (permalink)
Newsgroups comp.lang.java.gui
References <iFlch.17722$9v5.15668@newssvr29.news.prodigy.net>
Date 2011-04-27 15:26 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.help,comp.
On Sat, 02 Dec 2006 20:49:18 -0000, SkippyBoy  
<skippyboy2005+NOSPAM@gmail.com> wrote:

> Hi all - I have an application where my main frame has a tabbed  
> interface,
> and each tab has a JPanel.
>
> I would like to draw a line graph on the second tab (the first tab is  
> where
> data is entered) and a bar graph on the second tab.
>
> The problem I have is how to draw on the second or 3rd tabs.
>
> I googled and one solution was to subclass the JPanel and then override  
> the
> paintComponent() method. I tried but it doesn't seem to work. I am  
> probably
> just doing it wrong.
>
> How would I go about defining/extending the JPanel class? or is there  
> some
> other container that would serve this purpose better?
>
> Any help is appreciated.

Sub-classing JComponent directly is probably more appropriate.  Even  
easier is using a ready-made library such as JFreechart.

You might get better advice from comp.lang.java.gui (this reply is  
cross-posted with follow-ups set to comp.lang.java.gui only).

Dan.

-- 
Daniel Dyer
http://www.uncommons.org

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | Next | Find similar


Thread

Re: Drawing on Tabs "Daniel Dyer" <daniel.dyer@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000

csiph-web