私は Swing と WindowsBuilder を使用しており、Eclipse 環境は UNIX サーバー上で実行されています。
JTextField
プログラムを実行し、別のウィンドウからプログラムにデータをコピーして貼り付けようとするたびに、JTextField
応答が停止します。
つまり、Eclipse で再生を押すと、フォームが起動してJTextField
応答しますが、+ を押して 別のウィンドウに移動し、alt+を押してからもう一度+を押して実行中のプログラムに戻りますが、何も応答しません。tabctrlcalttabJTextField
誰かを助けます?
ありがとう
ここにコードがあります:
import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.EventQueue;
import javax.swing.ButtonGroup;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.text.DefaultFormatter;
import javax.swing.JLabel;
import java.awt.Font;
import java.awt.Color;
import javax.swing.JCheckBox;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.file.Files;
import java.text.DecimalFormat;
import javax.swing.JTextField;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import javax.swing.DropMode;
public class MainPage extends JFrame {
private JPanel contentPane;
private String sSpe1;
private String sSpe2;
private JTextField txtTomB1;
private JTextField txtTomB2;
private JTextField txtTomB3;
private JTextField txtTomB4;
private JTextField txtTomB5;
private JTextField txtPotB1;
private JTextField txtPotB2;
private JTextField txtPotB3;
private JTextField txtPotB4;
private JTextField txtPotB5;
private JTextField txtAraB1;
private JTextField txtAraB2;
private JTextField txtAraB3;
private JTextField txtAraB4;
private JTextField txtAraB5;
private JTextField[] arrTomBaits = new JTextField[5];
private JTextField[] arrPotBaits = new JTextField[5];
private JTextField[] arrAraBaits = new JTextField[5];
private JLabel lblNote;
private JLabel lblChooseLocation;
private JTextField txtLocation;
private JButton btnBrowse;
private boolean bCanContinue;
private JSpinner spinner;
private JSpinner spnRValueBelow;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
MainPage frame = new MainPage();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public MainPage()
{
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 551, 609);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setSize(600, 1000);
setContentPane(contentPane);
contentPane.setLayout(null);
txtTomB1 = new JTextField();
txtTomB1.setDropMode(DropMode.INSERT);
txtTomB1.setBounds(20, 308, 86, 20);
contentPane.add(txtTomB1);
txtTomB1.setColumns(10);
arrTomBaits[0] = txtTomB1;
txtTomB2 = new JTextField();
txtTomB2.setDropMode(DropMode.INSERT);
txtTomB2.setColumns(10);
txtTomB2.setBounds(20, 339, 86, 20);
contentPane.add(txtTomB2);
arrTomBaits[1] = txtTomB2;
txtTomB3 = new JTextField();
txtTomB3.setDropMode(DropMode.INSERT);
txtTomB3.setColumns(10);
txtTomB3.setBounds(20, 370, 86, 20);
contentPane.add(txtTomB3);
arrTomBaits[2] = txtTomB3;
txtTomB4 = new JTextField();
txtTomB4.setDropMode(DropMode.INSERT);
txtTomB4.setColumns(10);
txtTomB4.setBounds(20, 401, 86, 20);
contentPane.add(txtTomB4);
arrTomBaits[3] = txtTomB4;
txtTomB5 = new JTextField();
txtTomB5.setDropMode(DropMode.INSERT);
txtTomB5.setColumns(10);
txtTomB5.setBounds(20, 432, 86, 20);
contentPane.add(txtTomB5);
arrTomBaits[4] = txtTomB5;
txtPotB1 = new JTextField();
txtPotB1.setDropMode(DropMode.INSERT);
txtPotB1.setColumns(10);
txtPotB1.setBounds(122, 308, 86, 20);
contentPane.add(txtPotB1);
arrPotBaits[0] = txtPotB1;
txtPotB2 = new JTextField();
txtPotB2.setDropMode(DropMode.INSERT);
txtPotB2.setColumns(10);
txtPotB2.setBounds(122, 339, 86, 20);
contentPane.add(txtPotB2);
arrPotBaits[1] = txtPotB2;
txtPotB3 = new JTextField();
txtPotB3.setDropMode(DropMode.INSERT);
txtPotB3.setColumns(10);
txtPotB3.setBounds(122, 370, 86, 20);
contentPane.add(txtPotB3);
arrPotBaits[2] = txtPotB3;
txtPotB4 = new JTextField();
txtPotB4.setDropMode(DropMode.INSERT);
txtPotB4.setColumns(10);
txtPotB4.setBounds(122, 401, 86, 20);
contentPane.add(txtPotB4);
arrPotBaits[3] = txtPotB4;
txtPotB5 = new JTextField();
txtPotB5.setDropMode(DropMode.INSERT);
txtPotB5.setColumns(10);
txtPotB5.setBounds(122, 432, 86, 20);
contentPane.add(txtPotB5);
arrPotBaits[4] = txtPotB5;
txtAraB1 = new JTextField();
txtAraB1.setDropMode(DropMode.INSERT);
txtAraB1.setColumns(10);
txtAraB1.setBounds(234, 308, 86, 20);
contentPane.add(txtAraB1);
arrAraBaits[0] = txtAraB1;
txtAraB2 = new JTextField();
txtAraB2.setDropMode(DropMode.INSERT);
txtAraB2.setColumns(10);
txtAraB2.setBounds(234, 339, 86, 20);
contentPane.add(txtAraB2);
arrAraBaits[1] = txtAraB2;
txtAraB3 = new JTextField();
txtAraB3.setDropMode(DropMode.INSERT);
txtAraB3.setColumns(10);
txtAraB3.setBounds(234, 370, 86, 20);
contentPane.add(txtAraB3);
arrAraBaits[2] = txtAraB3;
txtAraB4 = new JTextField();
txtAraB4.setDropMode(DropMode.INSERT);
txtAraB4.setColumns(10);
txtAraB4.setBounds(234, 401, 86, 20);
contentPane.add(txtAraB4);
arrAraBaits[3] = txtAraB4;
txtAraB5 = new JTextField();
txtAraB5.setDropMode(DropMode.INSERT);
txtAraB5.setColumns(10);
txtAraB5.setBounds(234, 432, 86, 20);
contentPane.add(txtAraB5);
arrAraBaits[4] = txtAraB5;
txtLocation = new JTextField();
txtLocation.setBounds(20, 492, 248, 20);
contentPane.add(txtLocation);
txtLocation.setColumns(10);
}
}
問題は、すべての txtARAB#、txtTomB#、txtPotB#、および txtLocation にあります。