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

commit

parent 9cfb4f1b
No related branches found
No related tags found
1 merge request!34Added encryption
......@@ -357,7 +357,7 @@ public class DrawingArea extends JPanel implements MouseMotionListener, MouseLis
/// Eraser is continuously drawing "small white circle" from current point to previous point ///
case ERASE:
((Ellipse2D) drawing).setFrame(currentPoint.getX(), currentPoint.getY(), 10, 10);
((Ellipse2D) drawing).setFrame(currentPoint.getX(), currentPoint.getY(), eraserSize, eraserSize);
g2.setColor(Color.WHITE);
g2.fill(drawing);
g2.draw(drawing);
......
......@@ -21,14 +21,13 @@ public class PaintGUI extends JPanel {
DrawingArea drawingArea;
String[] shapes = {"Freehand", "Line", "Circle", "Rectangle", "Oval", "Eraser", "Text"};
String[] strokes = {"Small", "Medium", "Large"};
String[] strokes = {"Thin", "Medium", "Thick"};
String[] eraserSizes = {"Small", "Medium", "Large"};
JFrame frame;
JButton clearBtn, newBtn, openBtn, saveBtn, saveAsBtn;
JButton freehandBtn, lineBtn, circleBtn, rectBtn, ovalBtn, eraserBtn, textBtn;
JButton colorPaletteBtn, setFontBtn;
JTextField textInput;
JTextField textSize;
JTextField textInput, textSize;
JComboBox strokeOptions;
JComboBox eraserSizeOptions;
......@@ -133,12 +132,12 @@ public class PaintGUI extends JPanel {
toolbox1.add(circleBtn);
toolbox1.add(rectBtn);
toolbox1.add(ovalBtn);
toolbox1.add(eraserBtn);
toolbox1.add(textBtn);
toolbox1.add(strokeOptions);
toolbox2.add(textBtn);
toolbox2.add(textInput);
// toolbox2.add(setFontBtn);
toolbox2.add(textSize);
toolbox2.add(strokeOptions);
toolbox2.add(eraserBtn);
toolbox2.add(eraserSizeOptions);
toolbox2.add(clearBtn);
......@@ -302,13 +301,13 @@ public class PaintGUI extends JPanel {
String strokeChosen = (String) strokeOptions.getSelectedItem();
switch (strokeChosen) {
case "Small":
case "Thin":
drawingArea.setStroke(3);
break;
case "Medium":
drawingArea.setStroke(6);
break;
case "Large":
case "Thick":
drawingArea.setStroke(10);
break;
}
......@@ -383,17 +382,4 @@ public class PaintGUI extends JPanel {
drawingArea.setModeText(textString, size);
}
// public void showGUI() {
// frame = new JFrame("Shared Whiteboard System");
// JFrame.setDefaultLookAndFeelDecorated(true);
// frame.setContentPane(global);
//
// frame.setSize(800, 600);
// frame.setLocationRelativeTo( null );
// frame.setResizable(false);
// frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// frame.setVisible(true);
// }
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment