Skip to content
Snippets Groups Projects
Commit 025629b0 authored by Hai HoDac's avatar Hai HoDac
Browse files

fixed GUI layout

fixed new button bug
parent f78c86e4
No related branches found
No related tags found
No related merge requests found
......@@ -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();
}
......
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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment