Results 1 to 2 of 2
  1. #1
    nat is offline Member
    Join Date
    Dec 2013
    Rep Power

    Default Displaying pie chart in a JScrollPane


    I have a JScrollPane and JTable inside. In the right column of the table at the end (south) I made a ChartPanel in one of the classes where I make the design for the Frame:

    Java Code:
    ChartPanel chartpanel = new ChartPanel(pieChart);
                            pCapturing.add(chartpanel, BorderLayout.NORTH);
    and when I click on any row above, from the list in the column, I would like an appropriate pie chart to be drawn.

    I need here (in another class where I define the getTableCellRendererComponent) to enter a code to display the chart in the last row of the panel:

    Java Code:
    PieChart3 pie=sectionsChartProvider.getSectionPieChart(section);
       if((hasFocus) || (isSelected)) {
                if(column == 0)
                    setBorder( new MatteBorder(1, 1, 1, 0, colorBorder) );
                else if(column == table.getColumnCount()-1)
                    setBorder( new MatteBorder(1, 0, 1, 1, colorBorder) );
                    setBorder( new MatteBorder(1, 0, 1, 0, colorBorder) );
    But, I don't know how to do this. Can anybody help me please?


    P.S. I also have a class for drawing the pie chart.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Washington, DC
    Rep Power

    Default Re: Displaying pie chart in a JScrollPane

    What exactly are you confused about?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. jfreechart plotting line chart on candlestick chart
    By amlwwalker in forum New To Java
    Replies: 0
    Last Post: 10-07-2012, 01:18 AM
  2. problems displaying chart
    By kkGG in forum Advanced Java
    Replies: 4
    Last Post: 01-31-2012, 06:08 PM
  3. JList inside JScrollPane is not displaying
    By _SAS in forum AWT / Swing
    Replies: 2
    Last Post: 07-31-2011, 08:45 PM
  4. how to record movement and displaying in chart
    By dianulhaq in forum AWT / Swing
    Replies: 0
    Last Post: 02-06-2011, 03:17 AM
  5. Demo bar chart and pie chart
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-23-2008, 11:22 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts