📄 win1.java
字号:
String[] d=c.book(1,c1);
textField11.setText(d[0]);
textField_212.setText(d[1]);
textField_313.setText(d[2]);
textField_414.setText(d[3]);
textField_515.setText(d[4]);
textField_616.setText(d[5]);
textField_717.setText(d[6]);
textField_818.setText(d[7]);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NotBoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
});
per++;
button_12.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
int ii=JOptionPane.showConfirmDialog(null, "确定删除么?");
if(ii==0)
{
Calculator c;
int c1=0;
int c2=0;
int c3=0;
; try
{
c1=Integer.parseInt(textField11.getText());
}
catch (Exception e) {
// TODO Auto-generated catch block
JOptionPane.showMessageDialog(null, "输入有误,请重新输入");
textField11.setText("");
c3=1;
}
// System.out.print("fff7");
if(c3==0)
{
try {
c = (Calculator)
Naming.lookup(
"rmi://localhost/CalculatorService");
// System.out.print("fff7");
boolean sf=c.book(c1);
if (sf == false) {
JOptionPane.showMessageDialog(null, "对不起,数据库无此书记录,请确认您的输入");
}
else {
String[] d=c.book(0,Integer.parseInt(tj1[0]));
textField11.setText(d[0]);
textField_212.setText(d[1]);
textField_313.setText(d[2]);
textField_414.setText(d[3]);
textField_515.setText(d[4]);
textField_616.setText(d[5]);
textField_717.setText(d[6]);
textField_818.setText(d[7]);
JOptionPane.showMessageDialog(null, "删除成功");
}
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NotBoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}});
per++;
button_121.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
int ii=JOptionPane.showConfirmDialog(null, "确定删除么?");
if(ii==0)
{
Calculator c;
int c1=0;
int c2=0;
int c3=0;
; try
{
c1=Integer.parseInt(textField_221.getText());
}
catch (Exception e) {
// TODO Auto-generated catch block
JOptionPane.showMessageDialog(null, "输入有误,请重新输入");
textField_221.setText("");
c3=1;
}
// System.out.print("fff7");
if(c3==0)
{
try {
c = (Calculator)
Naming.lookup(
"rmi://localhost/CalculatorService");
// System.out.print("fff7");
boolean sf=c.reader(c1);
if (sf == false) {
JOptionPane.showMessageDialog(null, "对不起,数据库无此读者记录,请确认您的输入");
}
else {
String[] d=c.reader(0,Integer.parseInt(tj1[1]));
textField_221.setText(d[0]);
textField_322.setText(d[1]);
textField_423.setText(d[2]);
textField_524.setText(d[3]);
textField_625.setText(d[4]);
textField_726.setText(d[5]);
JOptionPane.showMessageDialog(null, "删除成功");
}
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NotBoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}});
per++;
button_141.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
Calculator c;
int c1=0;
int c2=0;
int c3=0;
try
{
c1=Integer.parseInt(textField_221.getText());
}
catch (Exception e) {
// TODO Auto-generated catch block
JOptionPane.showMessageDialog(null, "输入有误,请重新输入");
textField_221.setText("");
c3=1;
}
if(c3==0)
{
try {
c = (Calculator)
Naming.lookup(
"rmi://localhost/CalculatorService");
String[] d=c.reader(1,c1);
textField_221.setText(d[0]);
textField_322.setText(d[1]);
textField_423.setText(d[2]);
textField_524.setText(d[3]);
textField_625.setText(d[4]);
textField_726.setText(d[5]);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NotBoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
});
per++;
try {
c = (Calculator)
Naming.lookup(
"rmi://localhost/CalculatorService");
String[] d=c.book(0,Integer.parseInt(tj1[0]));
textField11.setText(d[0]);
textField_212.setText(d[1]);
textField_313.setText(d[2]);
textField_414.setText(d[3]);
textField_515.setText(d[4]);
textField_616.setText(d[5]);
textField_717.setText(d[6]);
textField_818.setText(d[7]);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NotBoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
per++;
button_11.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
boolean sf = false;
int p1 = 0;
int p2 = 0;
int p3 = 0;
String b = "";
String c = "";
String d = "";
double t = 0;
String f = "";
String g = "";
String h = "";
int a = 0;
b = textField_212.getText();
d = textField_414.getText();
c = textField_313.getText();
f = textField_616.getText();
g = textField_717.getText();
h = textField_818.getText();
if (!(h.equals("借出")||h.equals("在馆")))
p3=1;
try {
a = Integer.parseInt(textField11.getText());
} catch (Exception e) {
p1 = 1;
}
try {
t = Double.parseDouble(textField_515.getText());
} catch (Exception e) {
p2 = 1;
}
if (p1 == 0 && p2 == 0 && p3 == 0) {
try {
Calculator tj = (Calculator) Naming
.lookup("rmi://localhost/CalculatorService");
sf = tj.book(a, b, c, d, t, f,g,h, 0);
} catch (RemoteException e) {
// TODO 自动生成 catch 块
e.printStackTrace();
} catch (SQLException e) {
// TODO 自动生成 catch 块
e.printStackTrace();
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NotBoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// System.out.print(sf);
if (sf == false) {
JOptionPane.showMessageDialog(null, "已经有这本图书,无法插入图书");
} else {
JOptionPane.showMessageDialog(null, "添加成功");
}
}
if (p1 == 1) {
textField11.setText("");
JOptionPane.showMessageDialog(null, "图书号输入不合法,请输入数字");
}
if (p2 == 1) {
textField_515.setText("");
JOptionPane.showMessageDialog(null, "图书单价输入不合法,请输入数字");
}
if (p3 == 1) {
textField_818.setText("");
JOptionPane.showMessageDialog(null, "图书状态输入不合法,请重新输入");
}
}
});
per++;
button41.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
int p1 = 0;
int p2 = 0;
int p3 = 0;
int b=0;
int t = 0;
int a = 0;
b=Integer.parseInt((String)comboBox_13.getSelectedItem());
try {
a = Integer.parseInt(textField_242.getText());
} catch (Exception e) {
p1 = 1;
}
try {
t = Integer.parseInt(textField_343.getText());
} catch (Exception e) {
p2 = 1;
}
if (p1 == 0 && p2 == 0 && p3 == 0) {
try {
Calculator tj = (Calculator) Naming
.lookup("rmi://localhost/CalculatorService");
tj.config(b,a,t);
} catch (RemoteException e) {
// TODO 自动生成 catch 块
e.printStackTrace();
} catch (SQLException e) {
// TODO 自动生成 catch 块
e.printStackTrace();
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NotBoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// System.out.print(sf);
}
if (p1 == 1) {
textField11.setText("");
JOptionPane.showMessageDialog(null, "最大借书数目不合法,请输入数字");
}
if (p2 == 1) {
textField_515.setText("");
JOptionPane.showMessageDialog(null, "最大借书天数不合法,请输入数字");
}
}
});
per++;
buttongl.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
int[] p= new int[4];
int[] p1= new int[4];
int[] p2= new int[4];
for (int i=0;i<4;i++)
{
p1[i]=0;
}
String[] nr=new String[4];
// for (int i=0;i<4;i++)
p[0]=comboBox.getSelectedIndex()+1;
p[1]=comboBox_2.getSelectedIndex()+1;
p[2]=comboBox_3.getSelectedIndex()+1;
p[3]=comboBox_4.getSelectedIndex()+1;
p2[0]=comboBox_5.getSelectedIndex()+1;
p2[1]=comboBox_10.getSelectedIndex()+1;
p2[2]=comboBox_11.getSelectedIndex()+1;
p2[3]=comboBox_12.getSelectedIndex()+1;
nr[0]=textFieldgl.getText();
nr[1]=textField_2gl.getText();
nr[2]=textField_3gl.getText();
nr[3]=textField_4gl.getText();
for (int i=0;i<4;i++)
{
if(nr[i].equals(""))
nr[i]="~。。~";
}
try {
Calculator tj = (Calculator) Naming
.lookup("rmi://localhost/CalculatorService");
String[] fh=tj.searchbook(p,nr,p1,p2);
int t=fh.length;
String[][] rb=new String[6][t/6];
for(int i=0;i<t/6;i++)
{
for(int q=0;q<6;q++)
{
rb[q][i]=fh[q+i*6];
}
}
RBS frame = new RBS(rb[0], rb[1], rb[2], rb[3], rb[4], rb[5]);
frame.setVisible(true);
} catch (RemoteException e) {
// TODO 自动生成 catch 块
e.printStackTrace();
} catch (SQLException e) {
// TODO 自动生成 catch 块
e.printStackTrace();
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NotBoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// System.out.print(sf);
}
});
per++;
button_13.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
boolean sf = false;
int p1 = 0;
int p2 = 0;
int p3 = 0;
String b = "";
String c = "";
String d = "";
double t = 0;
String f = "";
String g = "";
String h = "";
int a = 0;
b = textField_212.getText();
d = textField_414.getText();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -