JPanel
を拡張している人のクラスの内部に統計データをグラフ化する必要があります。今の計画は、次のようにpaintComponent
とGraphics
クラスを使用することです:JPanelではこのようにグラフを作成できますか?
public void paintComponent(Graphics g) {
super.paintComponent(g);
//create a rectangle to represent the outline of the graph
g.drawRect(300, 50, 400, 350);
//set up the datapoints
for(int i = 0; i < data.size(); i++) {
//put the datapoints where ever they need to go within this rectangle
g.drawOval(x, y, width, height);
}
}
は、何らかの理由でこの恐ろしいですか?もっと重要なのは、使えそうなグラフライブラリがありますが、わかりません。
ありがとうございました。
も参照してください[はJFreeChartタグ]は考えてみましょう。 – trashgod