1
我有我使用過JPanel和Graphics2D的這個塗料項目。除了油漆本身質量不好並且像素化之外,一切都很好。我該如何改進它?這是我安裝我的畫筆:提高塗料質量
public void setupbrush(){
strk= new BasicStroke(4, Stroker.CAP_ROUND, BasicStroke.JOIN_ROUND);
bru1=(Graphics2D)jPanel1.getGraphics();
bru1.fillRect(0, 0, getSize().width, getSize().height);
bru1.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
bru1.fillRect(10, 10, getSize().width, getSize().height);
bru1.setPaint(Color.red);
bru1.setStroke(strk);
}