From: David H. <Dav...@na...> - 2004-03-09 21:02:46
|
I know you have to repaint the screen every time you resize your screen. But my problem with JDK 1.4.1 on Mac OS X 10.2 is nothing gets displayed when you run the program first time from the command line. It just sits there and does nothing. But if you run the same program against 1.4.2 (that is only available for OS X 10.3), all the components are displayed properly (as far as I can tell). But you see an error message in the chart that says "problems" in italics bold at the bottom of the screen. So something is not being interpreted properly. It works beautifully on Linux. I'll try this on Windows, Solaris, and DEC Alpha and report the outcome in about 2 weeks. I'm having this problem wh >are you sure you are not simply having problems with having the >chart repaint itself? If yuo >change the size of the window or component, repaint() gets called on >that component so you need to >ooverride this method to redraw the chart. > > > >--- David Han <Dav...@na...> wrote: >> Just tried the same program on Mac OS X 10.3 with JDK 1.4.2. Graph >> shows up, but not everything gets displayed properly. This is still >> much better than 1.4.1 that just sits there and does nothing. >> >> David >> >> >> >Never mind - nothing is wrong with my code. My code works fine on >> >Linux, but it doesn't work on Mac OS X with JDK 1.4.1. I'll try my >> >code with JDK 1.4.2 on Mac OS X and see if that works. Will keep >> >you posted. >> > >> >David >> > >> >>>did you look at the SwingDemo in the demo package? >> >> >> >> >> >>Yes, I did look prior to posting my message. I don't any >> >>difference between my code and the SwingDemo.java code. What is my >> >>code missing? >> >> >> >> private void initComponents() throws ChartDataException, >>PropertyException >> >> { >> >> this.setSize( width, height ); >> >> this.panel =3D new JPanel( true ); >> >> this.panel.setSize( width, height ); >> >> this.getContentPane().add( this.panel ); >> >> this.setVisible( true ); >> >> >> >> String[] xAxisLabels =3D { "1998", "1999", "2000", "2001", >> >> "2002", "2003", "2004" }; >> >> String xAxisTitle =3D "Years"; >> >> String yAxisTitle =3D "Problems"; >> >> String title =3D "Micro$haft at Work"; >> >> DataSeries dataSeries =3D new DataSeries(xAxisLabels, xAxisTitl= e, >> >> yAxisTitle, title ); >> >> >> >> double[][] data =3D new double[][]{ { 250, 45, -36, 66, >>145, 80, 55 } }; >> >> String[] legendLabels =3D { "Bugs" }; >> >> Paint[] paints =3D {Color.blue}; >> >> >> >> Stroke[] strokes =3D { LineChartProperties.DEFAULT_LINE_STROKE = }; >> >> Shape[] shapes =3D { PointChartProperties.SHAPE_CIRCLE }; >> >> LineChartProperties lineChartProperties =3D new >> >>LineChartProperties(strokes, shapes >> >>); >> >> >> >> AxisChartDataSet axisChartDataSet =3D >> >> new AxisChartDataSet(data, legendLabels, paints, >>ChartType.LINE, >> >> lineChartProperties ); >> >> dataSeries.addIAxisPlotDataSet (axisChartDataSet); >> >> >> >> ChartProperties chartProperties =3D new ChartProperties(); >> >> AxisProperties axisProperties =3D new AxisProperties(); >> >> LegendProperties legendProperties =3D new LegendProperties(); >> >> >> >> AxisChart axisChart=3D new AxisChart(dataSeries, chartPropertie= s, >> >> axisProperties, >>legendProperties, >> >> 450, 450); >> >> axisChart.setGraphics2D ( (Graphics2D) this.panel.getGraphics()= ); >> >> axisChart.render(); >> >>} >> >> >> >> >> >>-- >> >>David Han >> >>dav...@gs... >> >>301-286-3617 >> >> >> >> >> >>------------------------------------------------------- >> >>This SF.Net email is sponsored by: IBM Linux Tutorials >> >>Free Linux tutorial presented by Daniel Robbins, President and CEO of >> >>GenToo technologies. Learn everything from fundamentals to system > > >>administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op= =3Dclick >> >>_______________________________________________ >> >>jCharts-users mailing list >> >>jCh...@li... >> >>https://lists.sourceforge.net/lists/listinfo/jcharts-users >> > >> > >> >-- >> >David Han >> >dav...@gs... >> >301-286-3617 >> > >> > >> >------------------------------------------------------- >> >This SF.Net email is sponsored by: IBM Linux Tutorials >> >Free Linux tutorial presented by Daniel Robbins, President and CEO of >> >GenToo technologies. Learn everything from fundamentals to system >> >administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dc= lick >> >_______________________________________________ >> >jCharts-users mailing list >> >jCh...@li... >> >https://lists.sourceforge.net/lists/listinfo/jcharts-users >> >> >> -- >> David Han >> dav...@gs... >> 301-286-3617 >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by: IBM Linux Tutorials >> Free Linux tutorial presented by Daniel Robbins, President and CEO of >> GenToo technologies. Learn everything from fundamentals to system >> administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dcl= ick >> _______________________________________________ >> jCharts-users mailing list >> jCh...@li... >> https://lists.sourceforge.net/lists/listinfo/jcharts-users > > >__________________________________ >Do you Yahoo!? >Yahoo! Search - Find what you=EDre looking for faster >http://search.yahoo.com > > >------------------------------------------------------- >This SF.Net email is sponsored by: IBM Linux Tutorials >Free Linux tutorial presented by Daniel Robbins, President and CEO of >GenToo technologies. Learn everything from fundamentals to system >administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dclick >_______________________________________________ >jCharts-users mailing list >jCh...@li... >https://lists.sourceforge.net/lists/listinfo/jcharts-users -- David Han dav...@gs... 301-286-3617 |