diff --git a/src/GUI/DrawingArea.java b/src/GUI/DrawingArea.java index 4df0903efa1151b3bbc3042599a995097fb82ce4..570ad5be5b0b3baa149f588c4c3db4b86457b402 100644 --- a/src/GUI/DrawingArea.java +++ b/src/GUI/DrawingArea.java @@ -94,6 +94,8 @@ public class DrawingArea extends JPanel implements MouseMotionListener, MouseLis public void clear() { image = new BufferedImage(AREA_WIDTH, AREA_HEIGHT, BufferedImage.TYPE_INT_ARGB); + g2 = (Graphics2D) image.getGraphics(); + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); repaint(); } diff --git a/src/GUI/PaintGUI.java b/src/GUI/PaintGUI.java index 78265a94fee2eb865f7cc7ce59fb1fe62c0c35dc..9cfdfd948526d341854121303309ab86590923a7 100644 --- a/src/GUI/PaintGUI.java +++ b/src/GUI/PaintGUI.java @@ -1,7 +1,6 @@ package GUI; import client.Client; -import remote.IDrawingUpdate; import javax.imageio.ImageIO; import javax.swing.*; @@ -107,7 +106,7 @@ public class PaintGUI extends JPanel { // setFontBtn = new JButton("Font"); // setFontBtn.addActionListener(actionListener); textInput = new JTextField("Text here."); - textInput.setColumns(8); + textInput.setColumns(13); textInput.addFocusListener(focusListener); // textInput.setVisible(false); textSize = new JTextField("12"); @@ -409,7 +408,13 @@ public class PaintGUI extends JPanel { private void setTextDetail() { String textString = textInput.getText(); - int size = Integer.parseInt(textSize.getText()); + int size = 12; // default + if (!textSize.getText().isEmpty()) { + size = Integer.parseInt(textSize.getText()); + } + else { + textSize.setText(Integer.toString(size)); + } drawingArea.setModeText(textString, size); }