一个项目在eclipse中需要多长时间运行? **固定的**
How long does a project take to run in eclipse? **FIXED**
好的,所以我在学校有一个计算机科学项目。该项目是创建一个 GUI 来计算应该对一个人的收入征收多少税。我 运行 遇到的问题是,每次我想 运行 我的程序实际启动需要 3 分钟。包括我老师在内的很多人都说这不正常。这是我的代码:
package me.findTax;
/*
* Notes:
* Fix the location of all the elements and create the math part of the program
*
* For some reason, takes eclipse a long time on home & school computers to run this program, not entirely sure why (2+ min)
*
* If something is not working, try looking a make sure that the change method is called after everytime that the getQuestion method is called
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
public class Main { //gives questions (source not included, keylistener included (currently not working), actionlistener included)
static JRadioButton b1;
static JRadioButton b2;
static JFrame frame;
static JPanel panel;
static JLabel L1;
static JLabel L2;
static JTextField tfield;
static ButtonGroup bg = new ButtonGroup();
static JButton B1;
static double tax;
static boolean married;
static ArrayList<String> poss_Questions = new ArrayList<String>();
private static int q;
// Only need 2 buttons because there is only one prompt (yes or no)
public static void change() {
if(q == 1) {
b1.setVisible(false);
b2.setVisible(false);
tfield.setVisible(true);
B1.setVisible(true);
} else if(q == 2) {
tfield.setVisible(false);
B1.setVisible(false);
L2.setText(Double.toString(tax)); //fix to make output more good
L2.setVisible(true);
L1.setLocation(10,20);
}
}
public static String getQuestion(){
String question = "";
if(q == 0){
question = poss_Questions.get(q);
} else if(q == 1){
question = poss_Questions.get(q);
} else if(q == 2){
doMath();
question = poss_Questions.get(q);
}
q++;
L1.setLocation(190, 20);
if(L1.getText().length() > 16) {
for(int t = 16; t < L1.getText().length(); t++) {
L1.setLocation(L1.getX() - 1, L1.getY());
}
}
if(L1.getText().length() < 16) {
for(int z = 16; z > L1.getText().length(); z++) {
L1.setLocation(L1.getX() + 1, L1.getY());
}
}
return question;
}
public static void checkAnswer(){
if(L1.getText().equals(poss_Questions.get(0))){
if(b1.isSelected()){
married = true;
} else if(b2.isSelected()){
married = false;
}
}
}
static int num;
public static void doMath(){
if(married){
try {
num = Integer.parseInt(tfield.getText());
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(null, "Please enter a whole number above zero without decimal points, commas", "ERROR", JOptionPane.ERROR_MESSAGE);
//may work
}
if(num > 0 && num <= 16000) {
tax = num*0.10; // 10%
} else if(num > 16000 && num <= 64000) {
tax = (1600 + (0.15*(num - 16000)));
} else if(num > 64000) {
tax = (8800 + (0.25*(num - 64000)));
} else {
JOptionPane.showMessageDialog(null, "Please enter a value greater than 0, without decimal points, and not in a string format", "Invalid Entry", JOptionPane.ERROR_MESSAGE);
}
} else if(!married){ //if single
try {
num = Integer.parseInt(tfield.getText());
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(null, "Please enter a whole number above zero without decimal points, commas", "ERROR", JOptionPane.ERROR_MESSAGE);
}
//use else if loops and else (else prints out that there was an error)
if(num > 0 && num <= 8000) {
tax = num*0.10; // 10%
} else if(num > 8000 && num <= 32000) {
tax = (800 + (0.15*(num - 8000)));
} else if(num > 32000) {
tax = (4400 + (0.25*(num - 32000)));
} else {
JOptionPane.showMessageDialog(null, "Please enter a value greater than 0, without decimal points, and not in a string format", "Invalid Entry", JOptionPane.ERROR_MESSAGE);
}
}
}
public static void main(String args[]){
poss_Questions.add("Are you married?");
poss_Questions.add("How much do you make? ($$ per year)");
poss_Questions.add("Here is how much tax will be taken away");
System.err.println("1");
b1 = new JRadioButton();
b1.setText("Yes");
b2 = new JRadioButton();
b2.setText("No");
System.err.println("2");
b1.setVisible(true);
b2.setVisible(true);
b1.setBounds(75, 150, 200, 30);
b2.setBounds(300, 150, 200, 30);
System.err.println("3");
bg.add(b1);
bg.add(b2);
System.err.println("4");
B1 = new JButton();
B1.setText("Submit");
B1.setVisible(true);
B1.setLocation(250, 50);
B1.setSize(75, 25);
B1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
checkAnswer();
L1.setText(getQuestion());
change();
}
});
System.err.println("5");
tfield = new JTextField();
tfield.setVisible(false);
tfield.setBounds(10, 50, 200, 20);
System.err.println("6"); //last output on console until program runs
L1 = new JLabel();
L1.setText(getQuestion());
change();
L1.setSize(400, 20);
L1.setLocation(10, 20);
System.err.println("7");
L2 = new JLabel();
L2.setVisible(false);
L2.setSize(400, 20);
L2.setLocation(10, 60);
L2.setText("Something went wrong");
System.err.println("8");
JOptionPane.showMessageDialog(null, L2.getX() + " " + L2.getY());
panel = new JPanel();
panel.setVisible(true);
frame = new JFrame();
frame.setVisible(true);
frame.add(panel);
frame.setSize(new Dimension(480, 270));
frame.setResizable(false);
System.err.println("9");
panel.add(b1);
panel.add(b2);
panel.add(B1);
panel.add(L1);
panel.add(tfield);
panel.add(L2);
panel.setLayout(null);
System.err.println("All");
}
}
我脑海中出现的主要问题是为什么需要这么长时间。该文件本身只有大约 6kb,我觉得它很小,不应该花那么长时间 运行。我试过将文件从 USB 移动到桌面,尝试了不同的计算机,没有效果。也许是我的代码布局?
我做了一些研究,没有论坛或教程网站说过类似这个问题的任何内容。
提前致谢
我居然输入了你的程序
问:Eclipse 程序是否需要三分钟或更长时间才能启动?
答:不,除非你有一台 VERRRY 慢的电脑,或者你已经超过 RAM 并且你正在点击交换。
问:您的程序是否比您"see something"最多占用三分钟?
答:是的。
建议:
在 "main()" 中设置一个断点,然后单击 "F6" 一次单步执行一行(and/or "F5" 单步执行您要检查的函数) .
提示:您的程序应该会立即启动,并且一切都会进行得很快......直到您点击 "getQuestion()" ;)
强烈建议:
"programming" 的一个重要部分是学习如何进行故障排除和调试。这是您熟悉如何使用 Eclipse 调试器单步执行代码的绝佳机会。
程序进入 "endless" 循环。
如果您在最后一个循环中查看 getQuestion():
if (L1.getText().length() < 16) {
for (int z = 16; z > L1.getText().length(); z++) {
L1.setLocation(L1.getX() + 1, L1.getY());
}
这个循环从 16 开始,当 L1.getText().length() < 16 因此 z > L1.getText().length() 根据定义为真。
当每次循环递增z时,z变得更大并且更符合条件。所以它是无限递增的。好吧,不是无止境的——当它变得足够大时,它就会溢出并变成负数。这是它停止的时候。
在下面的代码中,我用 z 的减量替换了增量。虽然我不知道它在逻辑上是否是您想要的 - 它消除了无限循环并且程序运行得更快。通过显示此错误导致您的问题:
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
public class Main { //gives questions (source not included, keylistener included (currently not working), actionlistener included)
static JRadioButton b1;
static JRadioButton b2;
static JFrame frame;
static JPanel panel;
static JLabel L1;
static JLabel L2;
static JTextField tfield;
static ButtonGroup bg = new ButtonGroup();
static JButton B1;
static double tax;
static boolean married;
static ArrayList<String> poss_Questions = new ArrayList<String>();
private static int q=0;
// Only need 2 buttons because there is only one prompt (yes or no)
public static String getQuestion() {
String question = "";
if (q == 0) {
question = poss_Questions.get(q);
} else if (q == 1) {
question = poss_Questions.get(q);
b1.setVisible(false);
b2.setVisible(false);
tfield.setVisible(true);
B1.setVisible(true);
} else if (q == 2) {
doMath();
question = poss_Questions.get(q);
tfield.setVisible(false);
B1.setVisible(false);
L2.setText(Double.toString(tax)); //fix to make output more good
L2.setVisible(true);
}
q++;
L1.setLocation(190, 20);
if (L1.getText().length() > 16) {
for (int t = 16; t < L1.getText().length(); t++) {
L1.setLocation(L1.getX() - 1, L1.getY());
}
}
if (L1.getText().length() < 16) {
for (int z = 16; z > L1.getText().length(); z--) {
L1.setLocation(L1.getX() + 1, L1.getY());
}
}
return question;
}
public static void checkAnswer() {
if (L1.getText().equals(poss_Questions.get(0))) {
if (b1.isSelected()) {
married = true;
} else if (b2.isSelected()) {
married = false;
}
}
}
static int num;
public static void doMath() {
if (married) {
try {
num = Integer.parseInt(tfield.getText());
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(null, "Please enter a whole number above zero without decimal points, commas", "ERROR", JOptionPane.ERROR_MESSAGE);
//may work
}
if (num > 0 && num <= 16000) {
tax = num * 0.10; // 10%
} else if (num > 16000 && num <= 64000) {
tax = (1600 + (0.15 * (num - 16000)));
} else if (num > 64000) {
tax = (8800 + (0.25 * (num - 64000)));
} else {
JOptionPane.showMessageDialog(null, "Please enter a value greater than 0, without decimal points, and not in a string format", "Invalid Entry", JOptionPane.ERROR_MESSAGE);
}
} else if (!married) { //if single
try {
num = Integer.parseInt(tfield.getText());
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(null, "Please enter a whole number above zero without decimal points, commas", "ERROR", JOptionPane.ERROR_MESSAGE);
}
//use else if loops and else (else prints out that there was an error)
if (num > 0 && num <= 8000) {
tax = num * 0.10; // 10%
} else if (num > 8000 && num <= 32000) {
tax = (800 + (0.15 * (num - 8000)));
} else if (num > 32000) {
tax = (4400 + (0.25 * (num - 32000)));
} else {
JOptionPane.showMessageDialog(null, "Please enter a value greater than 0, without decimal points, and not in a string format", "Invalid Entry", JOptionPane.ERROR_MESSAGE);
}
}
}
public static void main(String args[]) {
poss_Questions.add("Are you married?");
poss_Questions.add("How much do you make? ($$ per year)");
poss_Questions.add("Here is how much tax will be taken away");
b1 = new JRadioButton();
b1.setText("Yes");
b2 = new JRadioButton();
b2.setText("No");
b1.setVisible(true);
b2.setVisible(true);
b1.setBounds(75, 150, 200, 30);
b2.setBounds(300, 150, 200, 30);
bg.add(b1);
bg.add(b2);
B1 = new JButton();
B1.setText("Submit");
B1.setVisible(true);
B1.setLocation(340, 50);
B1.setSize(75, 25);
B1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
checkAnswer();
L1.setText(getQuestion());
}
});
tfield = new JTextField();
tfield.setVisible(false);
tfield.setBounds(100, 50, 200, 20);
L1 = new JLabel();
L1.setText(getQuestion());
L1.setSize(400, 20);
L1.setLocation(10, 20);
L2 = new JLabel();
L2.setVisible(false);
L2.setSize(400, 20);
L2.setLocation(10, 60);
L2.setText("Something went wrong");
JOptionPane.showMessageDialog(null, L2.getX() + " " + L2.getY());
panel = new JPanel();
panel.setVisible(true);
frame = new JFrame();
frame.setVisible(true);
frame.add(panel);
frame.setSize(new Dimension(480, 270));
frame.setResizable(false);
panel.add(b1);
panel.add(b2);
panel.add(B1);
panel.add(L1);
panel.add(tfield);
panel.add(L2);
panel.setLayout(null);
}
}
好的,所以我在学校有一个计算机科学项目。该项目是创建一个 GUI 来计算应该对一个人的收入征收多少税。我 运行 遇到的问题是,每次我想 运行 我的程序实际启动需要 3 分钟。包括我老师在内的很多人都说这不正常。这是我的代码:
package me.findTax;
/*
* Notes:
* Fix the location of all the elements and create the math part of the program
*
* For some reason, takes eclipse a long time on home & school computers to run this program, not entirely sure why (2+ min)
*
* If something is not working, try looking a make sure that the change method is called after everytime that the getQuestion method is called
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
public class Main { //gives questions (source not included, keylistener included (currently not working), actionlistener included)
static JRadioButton b1;
static JRadioButton b2;
static JFrame frame;
static JPanel panel;
static JLabel L1;
static JLabel L2;
static JTextField tfield;
static ButtonGroup bg = new ButtonGroup();
static JButton B1;
static double tax;
static boolean married;
static ArrayList<String> poss_Questions = new ArrayList<String>();
private static int q;
// Only need 2 buttons because there is only one prompt (yes or no)
public static void change() {
if(q == 1) {
b1.setVisible(false);
b2.setVisible(false);
tfield.setVisible(true);
B1.setVisible(true);
} else if(q == 2) {
tfield.setVisible(false);
B1.setVisible(false);
L2.setText(Double.toString(tax)); //fix to make output more good
L2.setVisible(true);
L1.setLocation(10,20);
}
}
public static String getQuestion(){
String question = "";
if(q == 0){
question = poss_Questions.get(q);
} else if(q == 1){
question = poss_Questions.get(q);
} else if(q == 2){
doMath();
question = poss_Questions.get(q);
}
q++;
L1.setLocation(190, 20);
if(L1.getText().length() > 16) {
for(int t = 16; t < L1.getText().length(); t++) {
L1.setLocation(L1.getX() - 1, L1.getY());
}
}
if(L1.getText().length() < 16) {
for(int z = 16; z > L1.getText().length(); z++) {
L1.setLocation(L1.getX() + 1, L1.getY());
}
}
return question;
}
public static void checkAnswer(){
if(L1.getText().equals(poss_Questions.get(0))){
if(b1.isSelected()){
married = true;
} else if(b2.isSelected()){
married = false;
}
}
}
static int num;
public static void doMath(){
if(married){
try {
num = Integer.parseInt(tfield.getText());
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(null, "Please enter a whole number above zero without decimal points, commas", "ERROR", JOptionPane.ERROR_MESSAGE);
//may work
}
if(num > 0 && num <= 16000) {
tax = num*0.10; // 10%
} else if(num > 16000 && num <= 64000) {
tax = (1600 + (0.15*(num - 16000)));
} else if(num > 64000) {
tax = (8800 + (0.25*(num - 64000)));
} else {
JOptionPane.showMessageDialog(null, "Please enter a value greater than 0, without decimal points, and not in a string format", "Invalid Entry", JOptionPane.ERROR_MESSAGE);
}
} else if(!married){ //if single
try {
num = Integer.parseInt(tfield.getText());
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(null, "Please enter a whole number above zero without decimal points, commas", "ERROR", JOptionPane.ERROR_MESSAGE);
}
//use else if loops and else (else prints out that there was an error)
if(num > 0 && num <= 8000) {
tax = num*0.10; // 10%
} else if(num > 8000 && num <= 32000) {
tax = (800 + (0.15*(num - 8000)));
} else if(num > 32000) {
tax = (4400 + (0.25*(num - 32000)));
} else {
JOptionPane.showMessageDialog(null, "Please enter a value greater than 0, without decimal points, and not in a string format", "Invalid Entry", JOptionPane.ERROR_MESSAGE);
}
}
}
public static void main(String args[]){
poss_Questions.add("Are you married?");
poss_Questions.add("How much do you make? ($$ per year)");
poss_Questions.add("Here is how much tax will be taken away");
System.err.println("1");
b1 = new JRadioButton();
b1.setText("Yes");
b2 = new JRadioButton();
b2.setText("No");
System.err.println("2");
b1.setVisible(true);
b2.setVisible(true);
b1.setBounds(75, 150, 200, 30);
b2.setBounds(300, 150, 200, 30);
System.err.println("3");
bg.add(b1);
bg.add(b2);
System.err.println("4");
B1 = new JButton();
B1.setText("Submit");
B1.setVisible(true);
B1.setLocation(250, 50);
B1.setSize(75, 25);
B1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
checkAnswer();
L1.setText(getQuestion());
change();
}
});
System.err.println("5");
tfield = new JTextField();
tfield.setVisible(false);
tfield.setBounds(10, 50, 200, 20);
System.err.println("6"); //last output on console until program runs
L1 = new JLabel();
L1.setText(getQuestion());
change();
L1.setSize(400, 20);
L1.setLocation(10, 20);
System.err.println("7");
L2 = new JLabel();
L2.setVisible(false);
L2.setSize(400, 20);
L2.setLocation(10, 60);
L2.setText("Something went wrong");
System.err.println("8");
JOptionPane.showMessageDialog(null, L2.getX() + " " + L2.getY());
panel = new JPanel();
panel.setVisible(true);
frame = new JFrame();
frame.setVisible(true);
frame.add(panel);
frame.setSize(new Dimension(480, 270));
frame.setResizable(false);
System.err.println("9");
panel.add(b1);
panel.add(b2);
panel.add(B1);
panel.add(L1);
panel.add(tfield);
panel.add(L2);
panel.setLayout(null);
System.err.println("All");
}
}
我脑海中出现的主要问题是为什么需要这么长时间。该文件本身只有大约 6kb,我觉得它很小,不应该花那么长时间 运行。我试过将文件从 USB 移动到桌面,尝试了不同的计算机,没有效果。也许是我的代码布局?
我做了一些研究,没有论坛或教程网站说过类似这个问题的任何内容。
提前致谢
我居然输入了你的程序
问:Eclipse 程序是否需要三分钟或更长时间才能启动?
答:不,除非你有一台 VERRRY 慢的电脑,或者你已经超过 RAM 并且你正在点击交换。
问:您的程序是否比您"see something"最多占用三分钟?
答:是的。
建议:
在 "main()" 中设置一个断点,然后单击 "F6" 一次单步执行一行(and/or "F5" 单步执行您要检查的函数) .
提示:您的程序应该会立即启动,并且一切都会进行得很快......直到您点击 "getQuestion()" ;)
强烈建议:
"programming" 的一个重要部分是学习如何进行故障排除和调试。这是您熟悉如何使用 Eclipse 调试器单步执行代码的绝佳机会。
程序进入 "endless" 循环。 如果您在最后一个循环中查看 getQuestion():
if (L1.getText().length() < 16) {
for (int z = 16; z > L1.getText().length(); z++) {
L1.setLocation(L1.getX() + 1, L1.getY());
}
这个循环从 16 开始,当 L1.getText().length() < 16 因此 z > L1.getText().length() 根据定义为真。
当每次循环递增z时,z变得更大并且更符合条件。所以它是无限递增的。好吧,不是无止境的——当它变得足够大时,它就会溢出并变成负数。这是它停止的时候。
在下面的代码中,我用 z 的减量替换了增量。虽然我不知道它在逻辑上是否是您想要的 - 它消除了无限循环并且程序运行得更快。通过显示此错误导致您的问题:
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
public class Main { //gives questions (source not included, keylistener included (currently not working), actionlistener included)
static JRadioButton b1;
static JRadioButton b2;
static JFrame frame;
static JPanel panel;
static JLabel L1;
static JLabel L2;
static JTextField tfield;
static ButtonGroup bg = new ButtonGroup();
static JButton B1;
static double tax;
static boolean married;
static ArrayList<String> poss_Questions = new ArrayList<String>();
private static int q=0;
// Only need 2 buttons because there is only one prompt (yes or no)
public static String getQuestion() {
String question = "";
if (q == 0) {
question = poss_Questions.get(q);
} else if (q == 1) {
question = poss_Questions.get(q);
b1.setVisible(false);
b2.setVisible(false);
tfield.setVisible(true);
B1.setVisible(true);
} else if (q == 2) {
doMath();
question = poss_Questions.get(q);
tfield.setVisible(false);
B1.setVisible(false);
L2.setText(Double.toString(tax)); //fix to make output more good
L2.setVisible(true);
}
q++;
L1.setLocation(190, 20);
if (L1.getText().length() > 16) {
for (int t = 16; t < L1.getText().length(); t++) {
L1.setLocation(L1.getX() - 1, L1.getY());
}
}
if (L1.getText().length() < 16) {
for (int z = 16; z > L1.getText().length(); z--) {
L1.setLocation(L1.getX() + 1, L1.getY());
}
}
return question;
}
public static void checkAnswer() {
if (L1.getText().equals(poss_Questions.get(0))) {
if (b1.isSelected()) {
married = true;
} else if (b2.isSelected()) {
married = false;
}
}
}
static int num;
public static void doMath() {
if (married) {
try {
num = Integer.parseInt(tfield.getText());
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(null, "Please enter a whole number above zero without decimal points, commas", "ERROR", JOptionPane.ERROR_MESSAGE);
//may work
}
if (num > 0 && num <= 16000) {
tax = num * 0.10; // 10%
} else if (num > 16000 && num <= 64000) {
tax = (1600 + (0.15 * (num - 16000)));
} else if (num > 64000) {
tax = (8800 + (0.25 * (num - 64000)));
} else {
JOptionPane.showMessageDialog(null, "Please enter a value greater than 0, without decimal points, and not in a string format", "Invalid Entry", JOptionPane.ERROR_MESSAGE);
}
} else if (!married) { //if single
try {
num = Integer.parseInt(tfield.getText());
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(null, "Please enter a whole number above zero without decimal points, commas", "ERROR", JOptionPane.ERROR_MESSAGE);
}
//use else if loops and else (else prints out that there was an error)
if (num > 0 && num <= 8000) {
tax = num * 0.10; // 10%
} else if (num > 8000 && num <= 32000) {
tax = (800 + (0.15 * (num - 8000)));
} else if (num > 32000) {
tax = (4400 + (0.25 * (num - 32000)));
} else {
JOptionPane.showMessageDialog(null, "Please enter a value greater than 0, without decimal points, and not in a string format", "Invalid Entry", JOptionPane.ERROR_MESSAGE);
}
}
}
public static void main(String args[]) {
poss_Questions.add("Are you married?");
poss_Questions.add("How much do you make? ($$ per year)");
poss_Questions.add("Here is how much tax will be taken away");
b1 = new JRadioButton();
b1.setText("Yes");
b2 = new JRadioButton();
b2.setText("No");
b1.setVisible(true);
b2.setVisible(true);
b1.setBounds(75, 150, 200, 30);
b2.setBounds(300, 150, 200, 30);
bg.add(b1);
bg.add(b2);
B1 = new JButton();
B1.setText("Submit");
B1.setVisible(true);
B1.setLocation(340, 50);
B1.setSize(75, 25);
B1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
checkAnswer();
L1.setText(getQuestion());
}
});
tfield = new JTextField();
tfield.setVisible(false);
tfield.setBounds(100, 50, 200, 20);
L1 = new JLabel();
L1.setText(getQuestion());
L1.setSize(400, 20);
L1.setLocation(10, 20);
L2 = new JLabel();
L2.setVisible(false);
L2.setSize(400, 20);
L2.setLocation(10, 60);
L2.setText("Something went wrong");
JOptionPane.showMessageDialog(null, L2.getX() + " " + L2.getY());
panel = new JPanel();
panel.setVisible(true);
frame = new JFrame();
frame.setVisible(true);
frame.add(panel);
frame.setSize(new Dimension(480, 270));
frame.setResizable(false);
panel.add(b1);
panel.add(b2);
panel.add(B1);
panel.add(L1);
panel.add(tfield);
panel.add(L2);
panel.setLayout(null);
}
}