通过groovy自定义函数实现提取明细表字段至主表字段.rar
通过groovy自定义函数实现提取明细表字段至主表字段,同时根据表单上的字段进行计算,将计算结果在字段上显示;致远、groovy
groovy将表单多个字段复制到一个字段内.rar
通过groovy脚本实现表单上的字段之间的自定义拼装,重复表字段封装到主表字段上。
v6.1版本新增加新闻删除监听事件
v6.1版本新增加新闻删除监听事件,需要将安装包解压缩,打入到项目中。
基于SSH的分页增删改查
基于SSH的分页增删改查
十盒新手入门,一步一步教你如何完成增删改查
用java写GUI图形界面
用java写GUI图形界面
public class login extends JFrame
{
private JComboBox nameJComboBox;
private JPanel userJPanel;
private JLabel pictureJLabel;
private JButton okJButton,cancelJButton;
private JLabel nameJLabel,passwordJLabel,note;
private JPasswordField passwordJPasswordField;
private String name1;
private String password1;
private String user;
private ImageIcon myImageIcon;
public login( )
{
createUserInterface(); // 调用创建用户界面方法
}
private void createUserInterface()
{
Container contentPane = getContentPane();
contentPane.setLayout( null );
userJPanel = new JPanel();
userJPanel.setBounds( 35, 120, 300, 96 );
userJPanel.setBorder(BorderFactory.createEtchedBorder() ); //显示一圈边儿
userJPanel.setLayout( null );
contentPane.add( userJPanel );
nameJComboBox = new JComboBox();
nameJComboBox.setBounds( 100, 12, 170, 25 );
nameJComboBox.addItem( "admin" );
nameJComboBox.addItem( "aloie" );
nameJComboBox.setSelectedIndex( 0 );
nameJComboBox.setEditable(true);
userJPanel.add( nameJComboBox );
pictureJLabel=new JLabel();
pictureJLabel.setBounds(45,0,380,118);
pictureJLabel.setIcon(new ImageIcon("pic.gif"));
contentPane.add(pictureJLabel);
nameJLabel=new JLabel("姓 名:");
nameJLabel.setBounds(20,12,80,25);
userJPanel.add(nameJLabel);
passwordJPasswordField=new JPasswordField();
passwordJPasswordField.setBounds(100,60,170,25);
userJPanel.add(passwordJPasswordField);
passwordJLabel=new JLabel("密 码:");
passwordJLabel.setBounds(20,60,80,25);
userJPanel.add(passwordJLabel);
note=new JLabel("密码与用户名相同");
note.setBounds(0,295,180,25);
add(note);
okJButton=new JButton("登 陆");
okJButton.setBounds(60,250,80,25);
contentPane.add(okJButton);
okJButton.addActionListener(
new ActionListener()
{
public void actionPerformed(ActionEvent event)
{
okJButtonActionPerformed(event);
}
}
);
cancelJButton=new JButton("取 消");
cancelJButton.setBounds(210,250,80,25);
contentPane.add(cancelJButton);
cancelJButton.addActionListener(
new ActionListener()
{
public void actionPerformed( ActionEvent event )
{
System.exit(0); //退出登陆
}
}
);
setTitle( "登陆窗口" );
setSize( 380, 350 );
setResizable( false ); //将最大化按钮设置为不可用
}
private void okJButtonActionPerformed( ActionEvent event )
{
//okJButton响应事件,检查用户名和密码的匹配
name1= nameJComboBox.getSelectedItem().toString();
if (name1.equals("admin") )
{
if (passwordJPasswordField.getText().equals("admin"))
{
showNewWindow();
setVisible( false);
} else
{
JOptionPane.showMessageDialog( this,"密码错误,拒绝登陆",
"密码错误 !", JOptionPane.ERROR_MESSAGE );
}
}
else if (name1.equals("aloie"))
{
if ( passwordJPasswordField.getText().equals("aloie") )
{
showNewWindow();
setVisible(false);
}
else
{
JOptionPane.showMessageDialog( this,"密码错误,拒绝登陆",
"密码错误 !", JOptionPane.ERROR_MESSAGE );
}
}
}
public void showNewWindow()
{
JFrame jf=new JFrame("main Frame");
jf.setSize(500,400);
jf.setVisible(true);
jf.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
}
public static void main( String[] args )
{
JFrame.setDefaultLookAndFeelDecorated(true);
login mylogin = new login( );
mylogin.setVisible( true );
mylogin.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
}
}