public void onResize() {
		int ch = max(getHeight() - textH * (component.length + 2), textH);
		int cw = max(getWidth(), textH);
		curve = new double[cw];
		canvas = new BufferedImage(cw, ch, BufferedImage.TYPE_INT_RGB);
		graph.setBounds(0, 0, cw, ch);
		graph.setIcon(new ImageIcon(canvas));

		for (int i = 0; i < component.length; i++) {
			for (int j = 0; j < component[i].length; j++) {
				int w = max(textH, cw / component[i].length);
				component[i][j].setBounds(j * w, ch + i * textH, w, textH);
			}
		}
		draw();
	}