📄 computerframe.java
字号:
panel.add(tf[12]) ;
panel.add(tf[13]) ;
panel2.add(panel,BorderLayout.NORTH) ;
panel2.add(list,BorderLayout.CENTER) ;
panel2.add(buttonnext,BorderLayout.SOUTH) ;
tf[11].addActionListener(
new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
try
{
i[10] = Integer.parseInt(tf[11].getText()) ;
sele sele = new sele("users",i[10]) ;
sele.rsd.next() ;
tf[12].setText(sele.rsd.getString(2)) ;
tf[13].setText(sele.rsd.getString(3)) ;
sele sele1 = new sele("da",i[10]) ;
list.add("water: "+"gas: "+"watermoney "+"gasmoney "+"zong "+"date: ",0) ;
while(sele1.rsd.next())
{
list.add(sele1.rsd.getInt(2)+" "+sele1.rsd.getInt(3)+" "+sele1.rsd.getInt(4)+" "+sele1.rsd.getInt(5)+" "+" "+sele1.rsd.getInt(6)+" "+sele1.rsd.getTimestamp(7)) ;
}
}//try
catch(Exception ex)
{
JOptionPane.showMessageDialog(new JFrame(), "Wrong no user", "Dialog",
JOptionPane.ERROR_MESSAGE);
}
}
}//actionlistener
) ;//tf[11]
buttonnext.addActionListener(
new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
tf[11].setText("") ;
tf[12].setText("") ;
tf[13].setText("") ;
list.clear() ;
}//action
}//actionlistener
) ;
}
public void createpage3()
{
panel3 = new JPanel() ;
panel3.setLayout(new BorderLayout()) ;
JPanel panel1 = new JPanel() ;
JPanel panel2 = new JPanel() ;
JPanel panel13 = new JPanel() ;
panel1.setLayout(new GridLayout(3,3)) ;
panel2.setLayout(new GridLayout(2,1)) ;
panel13.setLayout(new BorderLayout()) ;
panel1.add(new Label("UserID:",Label.LEFT)) ;
panel1.add(new Label("Name:",Label.LEFT)) ;
panel1.add(new Label("address",Label.LEFT)) ;
panel1.add(tf[16]) ;
panel1.add(tf[17]) ;
panel1.add(tf[18]) ;
panel1.add(new Label(" ")) ;
panel1.add(buttona) ;
panel2.add(tf[19]) ;
panel2.add(buttond) ;
panel13.add(buttonl,BorderLayout.SOUTH) ;
panel13.add(list1,BorderLayout.CENTER) ;
panel3.add(panel1,BorderLayout.NORTH) ;
panel3.add(panel2,BorderLayout.SOUTH) ;
panel3.add(panel13,BorderLayout.CENTER) ;
tf[16].addActionListener(
new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
try
{
i[11] = Integer.parseInt(tf[16].getText()) ;
sele sele = new sele("users") ;
while(sele.rsd.next())
{
if(sele.rsd.getInt(1) == i[11])
{
JOptionPane.showMessageDialog(new JFrame(), "Wrong have userid", "Dialog",
JOptionPane.ERROR_MESSAGE);
}//if
}//while
}//try
catch(Exception ex)
{
}//catch
}//actionperformed
}//actionlistener
) ;//tf[16]
buttona.addActionListener(
new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
try
{
// Timestamp ti = new Timestamp(System.currentTimeMillis()) ;
i[13] = Integer.parseInt(tf[16].getText()) ;
inse inse = new inse(i[13],tf[17].getText(),tf[18].getText()) ;
inse inse1 = new inse(i[13],0,0,0,0,0) ;
tf[17].setText("") ;
tf[18].setText("") ;
tf[16].setText("") ;
}//try
catch(Exception ex)
{
JOptionPane.showMessageDialog(new JFrame(), "Wrong!", "Dialog",
JOptionPane.ERROR_MESSAGE);
}
}//buttona
}//buttona
) ;
buttonl.addActionListener(
new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
try
{
sele sele = new sele("users") ;
list1.clear() ;
while(sele.rsd.next())
{
list1.add(sele.rsd.getInt(1)+" "+sele.rsd.getString(2)+" "+sele.rsd.getString(3)+""+sele.rsd.getTimestamp(4) ) ;
}
}//try
catch(Exception ex)
{ JOptionPane.showMessageDialog(new JFrame(), "Wrong!", "Dialog",
JOptionPane.ERROR_MESSAGE);
}//catch
}
}
) ;//buttonl
buttond.addActionListener(
new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
try
{
i[14] = Integer.parseInt(tf[19].getText()) ;
dele dele = new dele("users",i[14]) ;
dele dele1 = new dele("da",i[14]) ;
tf[19].setText("") ;
}//try
catch(Exception ex)
{ JOptionPane.showMessageDialog(new JFrame(), "Wrong!", "Dialog",
JOptionPane.ERROR_MESSAGE);
}//catch
}
}//actionlistener
) ;//button
}
public void createpage4()
{
panel4 = new JPanel() ;
panel4.setLayout(new GridLayout(2,1)) ;
JPanel panel1 = new JPanel() ;
JPanel panel2 = new JPanel() ;
panel1.setLayout(new BorderLayout()) ;
panel1.add(new Label("water",Label.LEFT),BorderLayout.NORTH) ;
panel1.add(tf[14],BorderLayout.CENTER) ;
// panel1.add(buttonw,BorderLayout.EAST) ;
panel2.setLayout(new BorderLayout()) ;
panel2.add(new Label("gap",Label.LEFT),BorderLayout.NORTH) ;
panel2.add(tf[15],BorderLayout.CENTER) ;
panel2.add(buttonw,BorderLayout.EAST) ;
panel4.add(panel1) ;
panel4.add(panel2) ;
buttonw.addActionListener(
new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
try
{
i[15] = Integer.parseInt(tf[14].getText()) ;
i[16] = Integer.parseInt(tf[15].getText()) ;
inse inse = new inse(i[15],i[16]) ;
tf[14].setText("") ;
tf[15].setText("") ;
}//try
catch(Exception ex)
{ JOptionPane.showMessageDialog(new JFrame(), "Wrong!", "Dialog",
JOptionPane.ERROR_MESSAGE);
}
}//buttonw
}
) ;//buttonw
}//createpage4
/**
* Shutdown procedure when run as an application.
*/
protected void windowClosed() {
// TODO: Check if it is safe to close the application
// Exit application.
System.exit(0);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -