From 0be46f95e63013598e3018a61e02a41fee47834c Mon Sep 17 00:00:00 2001 From: fdai6040 Date: Thu, 2 Feb 2023 15:23:48 +0100 Subject: [PATCH] JTextField font style changed --- src/main/java/src/TasksFrame.java | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/main/java/src/TasksFrame.java b/src/main/java/src/TasksFrame.java index b2de3c1..6d07a72 100644 --- a/src/main/java/src/TasksFrame.java +++ b/src/main/java/src/TasksFrame.java @@ -97,14 +97,17 @@ public class TasksFrame extends JFrame { JTextField a = new JTextField(); a.setBounds(10, 40, 30, 20); a.setVisible(true); + a.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); JTextField b = new JTextField(); b.setBounds(50, 40, 30, 20); b.setVisible(true); + b.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); JTextField c = new JTextField(); c.setBounds(90, 40, 30, 20); c.setVisible(true); + c.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); JLabel jLabel = new JLabel(); jLabel.setVisible(true); @@ -159,10 +162,12 @@ public class TasksFrame extends JFrame { JTextField a = new JTextField(); a.setBounds(10, 40, 30, 20); a.setVisible(true); + a.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); JTextField b = new JTextField(); b.setBounds(50, 40, 30, 20); b.setVisible(true); + b.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); JLabel jLabel = new JLabel(); jLabel.setVisible(true); @@ -183,6 +188,8 @@ public class TasksFrame extends JFrame { int res = kgV(val_a, val_b); jLabel.setText(String.valueOf(res)); } + + }); @@ -206,6 +213,7 @@ public class TasksFrame extends JFrame { JTextField jTextField = new JTextField(); jTextField.setVisible(true); jTextField.setBounds(10, 40, 30, 20); + jTextField.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); JLabel jLabel = new JLabel(); jLabel.setVisible(true); @@ -253,6 +261,9 @@ public class TasksFrame extends JFrame { JTextField jTextField = new JTextField(); jTextField.setVisible(true); jTextField.setBounds( 10, 40, 30, 20); + jTextField.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); + + JLabel jLabel = new JLabel(); jLabel.setVisible(true); @@ -334,6 +345,7 @@ public class TasksFrame extends JFrame { JTextField a = new JTextField(); a.setBounds(10, 50, 30, 20); a.setVisible(true); + a.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); JLabel sum = new JLabel(); sum.setBounds(40, 50, 10, 20); @@ -343,6 +355,7 @@ public class TasksFrame extends JFrame { JTextField b = new JTextField(); b.setBounds(50, 50, 30, 20); b.setVisible(true); + b.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); JLabel equal = new JLabel(); equal.setBounds(90, 50, 30, 20); @@ -352,6 +365,7 @@ public class TasksFrame extends JFrame { JTextField result = new JTextField(); result.setBounds(100, 50, 40, 20); result.setVisible(true); + result.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); JButton add = new JButton("add"); add.setBounds(10, 90, 100, 30); @@ -391,6 +405,7 @@ public class TasksFrame extends JFrame { JTextField x = new JTextField(); x.setBounds(10,50,30,20); x.setVisible(true); + x.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); JLabel diff = new JLabel(); diff.setBounds(40, 50, 10, 20); @@ -400,6 +415,7 @@ public class TasksFrame extends JFrame { JTextField y = new JTextField(); y.setBounds(50,50,30,20); y.setVisible(true); + y.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); JLabel equal = new JLabel(); equal.setBounds(90, 50, 30, 20); @@ -409,6 +425,7 @@ public class TasksFrame extends JFrame { JTextField result = new JTextField(); result.setBounds(100,50,40,20); result.setVisible(true); + result.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); JButton difference = new JButton("Difference"); difference.setBounds(10,90,100,30); @@ -458,10 +475,12 @@ public class TasksFrame extends JFrame { JTextField a = new JTextField(); a.setVisible(true); a.setBounds(50,25,30,20); + a.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); JTextField b = new JTextField(); b.setVisible(true); b.setBounds(50,45,30,20); + b.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); JButton area = new JButton("Calculate area"); area.setVisible(true); @@ -472,6 +491,7 @@ public class TasksFrame extends JFrame { JTextField areaRes = new JTextField(); areaRes.setBounds(200,80,30,20 ); areaRes.setVisible(true); + areaRes.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); area.addActionListener(new ActionListener() { @Override @@ -501,6 +521,7 @@ public class TasksFrame extends JFrame { JTextField perimeterRes = new JTextField(); perimeterRes.setBounds(200,110,30,20 ); perimeterRes.setVisible(true); + perimeterRes.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); perimeter.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -539,14 +560,17 @@ public class TasksFrame extends JFrame { JTextField a = new JTextField(); a.setBounds(10, 50, 30, 20); a.setVisible(true); + a.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); JTextField b = new JTextField(); b.setBounds(50, 50, 30, 20); b.setVisible(true); + b.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); JTextField result = new JTextField(); result.setBounds(100, 50, 40, 20); result.setVisible(true); + result.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); JButton sumFromTo = new JButton("calculate"); sumFromTo.setBounds(10,90,100,30); @@ -591,6 +615,7 @@ public class TasksFrame extends JFrame { JTextField jTextField = new JTextField(); jTextField.setVisible(true); jTextField.setBounds(3, 40, 250, 30); + jTextField.setFont(new java.awt.Font("Arial", Font.ROMAN_BASELINE | Font.BOLD, 12)); for (int i = from; i < to; i++) { int e = i % 5;