SlideShare a Scribd company logo
1 of 55
Download to read offline
Royal University of Phnom Penh
Department of Computer Science
Assignment:
JAVA Programming
Lecturer: Chi Kuong
Topic: កម្មវិធីកត់ចំណងដៃ
Class: E1
Year: 3
Group Member:
Soeng Saravit
Mann Makara
Khim Sokhy
Tem Dina
Generation: 17 Academic Year: 2015-2016
មាតិកា
I. ជំពូកទី ១ សេចកតីស្តើម្
1. បរ ិបទដៃការេិកាស្រាវស្រាវ
2. បញ្ហា សោទ
3. សោលបំណង
4. Scope and Limitations
5. Software / Hardware requirements
II. ជំពូកទី ២ Analysis, Design and Implement
III. ជំពូកទី ៣ សេចកតីេៃនិដ្ឋា ៃេសស្រម្ច ៃិង ម្តិសោបល់
IV. បញ្ជីស្ម ោះរូបភាព
1. Figure 1: Form Welcome
2. Figure 2: Form Create Data
3. Figure 3: Form Log in
4. Figure 4: Form Main
5. Figure 5: Form Update User
6. Figure 6: Form Guest
7. Figure 7: Form Update Guest Money
8. Figure 8: Form Report
9. Figure 9: Form About us
10. Figure 10: Form Help
V. Appendix A : How to use the program
VI. ឯការសោង
ជំពូកទី ១ សេចកតីស្តើម្
1. បរ ិបទដៃការេិកាស្រាវស្រាវ
ពិភពលោកលយើងលនេះបាននឹងកំពុងអភិវឌ្ឍពីមួយថ្ងៃលៅមួយថ្ងៃជាពិលេេខាងផ្នែកវិេ័យបលចេកវិទ្យាមានការ
រីកចល្មើនខាល ំងគួរឲ្យកត់េមាា ល់។យ៉ា ងណាមិញ លបើលយើង្កលលកមកលមើលលៅកែុង្បលទ្យេកមពុជាលយើងវិញបលចេកវិទ្យា
ក៏មានការរីកចល្មើនខាល ំងណាេ់ផ្ែរ ល ើយជាពិលេេ លៅកែុងពិធីមងាលការេម័យបចេុបបនែលយើងលមើលល ើញថាបាន
បញ្េូ លនូវបលចេកវិទ្យាជាល្ចើន ែូចជា ការងតរូប មានការបញ្េ ំងជា Video Pre wedding
ជាលែើម។លោយលមើលល ើញែូចលនេះល ើយបានជា្កុមរបេ់លយើងខ្ុំបានលលើកយកនូវកមមវិធីមួយផ្ែលជំនួយលៅកែុងពិ
ធីលរៀបអាពា ៍ពិពា ៍ គឺកមមវិធី កត់ចំណងដៃ លោយមានការផ្ែនំពីលោកសា្សាត ចារយ ជី គួង
ផ្ែលលោក្គូបានខិតខំបល្ងៀនអេ់ពីេមតថភាព។កមមវិធីបានជួយេ្មួលការងារល្ចើនែល់អែកផ្ែលកត់ចំែងថ្ែ
រួមទំងមាេ េ់កមមវិធីនងផ្ែរ។
2. បញ្ហា សោទ
លោយលមើលល ើញថាលៅកែុងពិធីលរៀបមងាលការនីមួយៗមាេ េ់កមមវិធីផ្តងផ្តរវល់មមាញឹកល្ចើនកែុងការចាត់ផ្ច
ងលរៀបចំកមមវិធី ពួកគាត់ផ្តងផ្តមានភាពខវេះចលនល េះណាមួយជាងជាពុំខាន។ តួយ៉ា ងែូចជាការលធវើបញ្េីរាយនមល្ម េះ
លភ្ៀវផ្ែលនឹង្តូវអលញ្ជើញ ជួនកាលមានការេទួនល្ម េះ ឬ ក៏មានការលភលចល្ម េះជាលែើម។
3. សោលបំណងដៃកម្មវិធី
លោយបានលរៀបរាប់លៅកែុងចំនុចខាងលលើលនេះខលេះរួចមកល ើយលយើងល ើញថាវាមានការលំបាកចំលពាេះមាេ េ់កមម
វិធីែូលចែេះលគាលបំែងថ្នកមមវិធីលនេះគឺជួយកាត់បនថយនូវបញ្ា ទំងអេ់លនេះបាន។កមមវិធីលនេះអាចលធវើការបូកេរុបនូវចំ
នួនទ្យឹក្បាក់ចំែងថ្ែរបេ់លភ្ៀវអាចលធវើការកត់្ានូវល្ម េះលភ្ៀវទំងអេ់ផ្ែល្តូវអលញ្ជើញងាយ្េួលផ្េវករល្ម េះ
លភ្ៀវជាមួយនឹងទ្យឹក្បាក់ចំែងថ្ែរបេ់គាត់ឬអាចជាអំលណាយវតថុអនុេាវរីយ៏ជាលែើម។កមមវិធីលនេះអាចរកាទ្យុកនូវ
រាល់ទ្យិនែន័យទំងអេ់មិនឲ្យបាត់បង់ឬខូចខាតល ើយ។កមមវិធីលនេះក៏អាចេរុបលធវើជារបាយការែ៏ នូវទ្យឹក្បាក់បាននង
ផ្ែរ។
4. Scope and Limitation
កមមវិធីលនេះអនុញ្ា តឲ្យអែកល្បើ្បាេ់បលងកើតគែនីផ្ទទ ល់ខលួនមួយេ្មាប់ចូលលៅល្បើ្បាេ់មុខងារេំខាន់ៗ
មួយចំនួន។ បនទ ប់ពីបលងកើតគែនីរួចល ើយ អែកល្បើ្បាេ់អាចបញ្េូ លនូវល្ម េះ កូនកំលោេះ កូន្កមុំ
រូបភាពកូនកំលោេះ កូន្កមុំ ថ្ងៃផ្ខឆ្ែ ំលរៀបមងាលការ។ មា៉ាងលទ្យៀតអែកល្បើ្បាេ់អាចបញ្េូ លល្ម េះលភ្ៀវផ្ែលនឹង្តូវ
អលញ្ជើញមកចូលរួមទំងអេ់ជាភាសាផ្ខមរ ឬ អង់លគលេ។ លលើេពីលនេះ អែកល្បើ្បាេ់អាចលធវើការបូកេរុបនូវចំែងថ្ែ
ចំនួនវតថុអនុេាវរីយ៍លនេងៗ អាចលធវើការផ្េវងរកល្ម េះលភ្ៀវរួមទំងទ្យឹក្បាក់ចំែងថ្ែបាននងផ្ែរ។ ល្ៅពីលនេះអែក
ល្បើ្បាេ់អាចលធវើជារបាយការែ៏ បានលទ្យៀតនង។
5. តស្រម្ូវការខាងផ្្នក Software/Hardware
១. ផ្នែក Hardware
- Processor: Intel Pentium 4, 1.6 GHz or Higher
- Hard Disk: Minimum of 1GB
- Memory: 128MB RAM or higher
- Display: Video Adapter and monitor with XGA (1024x768) or higher
២. ផ្នែក Software
- OS: Windows
- កមមវិធី កត់ចំែងថ្ែ
- Java Development Kit (JDK) to develop java programs.
- Microsoft SQL Server 2008 or Higher
ជំពូកទី ២ Analysis Design Implement
1. Analysis
មុននឹង្កុមលយើងខ្ុំចាប់លនតើមបលងកើតកមមវិធីលនេះល ើង្កុមរបេ់លយើងខ្ុំបានេិកាផ្េវងយល់ពីែំលែើ រការជាក់
ផ្េតងកែុងការចុេះល្ម េះលភ្ៀវ ផ្កត្មូវល្ម េះលភ្ៀវ លុប និងផ្េវងរកល្ម េះ។បនទ ប់ពីបានេិការួចមកលយើងកំែត់បាន
នូវលកខខែឌ មួយចំនួន៖
 បលងកើត Table ចំនួនពីរេ្មាប់នទុកទ្យិនែន័យ លោយល្បើ្បាេ់លៅកែុង Microsoft SQL Server 2012
 Table User: ល្បើេ្មាប់នទុកនូវល្ម េះកូនកំលោេះ កូន្កមុំ ថ្ងៃផ្ខឆ្ែ ំលរៀបពិធីមងាលការ
លលខកូែេមាៃ ត់េ្មាប់ល្បើ្បាេ់កមមវិធី។អាចរកាទ្យុក លុប ផ្កផ្្បតថ្មលបាននងផ្ែរ។
 Table Guest: ល្បើេ្មាប់នទុកនូវល្ម េះលភ្ៀវទំងអេ់ អាេ័យោា ន ងារ ចំែងថ្ែជា្បាក់លរៀល
្បាក់ែុោល រ និង អំលណាយលនេងៗ។អាចរកាទ្យុក លុប ផ្កផ្្បតថ្មលបាននងផ្ែរ។
 មុននឹងអាចល្បើ្បាេ់កមមវិធីលនេះបានជាែំបូងលយើង្តូវបលងកើតគែនីមួយ
 បនទ ប់ពីបានបលងកើតគែនីល ើយ អែកល្បើ្បាេ់អាចចូលលៅកាន់ Form េ្មាប់លធវើការងារជាល្ចើនបាន
ែូចជាកត់ល្ម េះលភ្ៀវ កត់ចំែងថ្ែលភ្ៀវ លធវើរបាយការបូកេរុបទ្យឹក្បាក់ចំែងថ្ែ
2. Design
លៅកែុងការ Design កមមវិធីលនេះឲ្យលមើលលៅមានភាព្េេ់សាា ត ្កុមលយើងខ្ុំបានល្បើ្បាេ់នូវ Swing
េ្មាប់លធវើជា Interface ល្ពាេះវាមានមុខងារជាល្ចើន និងនតល់ភាពងាយ្េួលកែុងការ Design GUI លៅកែុង Eclipse
IDE គួបនេំនឹង Graphic Design លោយល្បើ្បាេ់ Adobe Photoshop CS6 នងផ្ែរ។
លយើងបានបលងកើត Form មួយចំនួនាមត្មូវការល្បើ្បាេ់លៅកែុងកមមវិធីលនេះែូចខាងល្កាម៖
 From ែំបូងលពលលបើកកមមវិធី
លៅកែុង Form លនេះផ្ែរលយើងបានបលងកើតជាបូតុងមួយជារូបភាពេ្មាប់ចុចចូលលៅល្បើ្បាេ់នូវ
Form ែថ្ទ្យលទ្យៀតបាន។ លយើងបានបលងកើតបូតុងមួយលទ្យៀតេ្មាប់បិទ្យ Form នងផ្ែរ។ ែូចបងាា ញលៅកែុងរូបភាពខាង
ល្កាម។
Figure 1: Form Welcome
 From េ្មាប់បលងកើតទ្យិនែន័យងមី
លៅកែុង Form លនេះផ្ែរលយើងបានបលងកើតជាបូតុងពីរ មួយេ្មាប់រកាទ្យុកទ្យិនែន័យងមី និង
មួយលទ្យៀតេ្មាប់ចាកលចញពីកមមវិធី។ លៅលពលផ្ែលលយើងលបើកែំបូងលយើង្តូវបលងកើតទ្យិនែន័យជាមុនេិន។
Figure 2: Form បលងកើតទ្យិនែន័យ
 From េ្មាប់ចូលល្បើ្បាេ់កមមវិធី
លៅកែុង Form លនេះផ្ែរលយើងបានបលងកើតជាបូតុងពីរ មួយេ្មាប់បលងកើតទ្យិនែន័យងមី និង
មួយលទ្យៀតេ្មាប់ចូលល្បើ្បាេ់កមមវិធីទំងមូល លោយបញ្េូ លនូវពាកយេំងាត់ផ្ែលបានបលងកើតរួច ។
Figure 3: Form Log In
 From Main
លៅកែុង Form លនេះផ្ែរលយើងបានបលងកើតជាបូតុងចំនួន្បាំមួយផ្ែលជារូបភាព រួមទំងអកេរលៅពីខាង
ល្កាម េ្មាប់លធវើការងារលនេងៗែូចផ្ែលបានបងាា ញលៅកែុងរូបភាពខាងល្កាម ។ លយើងក៏បានបលងកើតបូតុងមួយ
េ្មាប់បិទ្យកមមវិធីលៅខាងល្កាម។
Figure 4: Form Main
 From េ្មាប់ផ្កផ្្បព័ត៌មានអែកល្បើ្បាេ់
លៅកែុង Form លនេះផ្ែរលយើងបានបលងកើតបូតុងពីរ CheckBox មួយ រួមទំង មាន Textfield
ជាល្ចើនេ្មាប់លធវើការ ផ្កផ្្បតថ្មលណាមួយែូចជា ល្ម េះកូននំលោេះកូន្កមុំ កាលបរិលចេទ្យមងាលការ
រួមទំងពាកយេមាៃ ត់នងផ្ែរ។
Figure 5: Form ផ្កផ្្បព៍ត៌មានអែកល្បើ្បាេ់
 From េ្មាប់បញ្េូ លព័ត៌មានលភ្ៀវផ្ែល្តូវអលញ្ជើញ
លៅកែុង Form លនេះផ្ែរលយើងបានបលងកើតបូតុងបួន ListView មួយ រួមទំង មាន Textfield
ជាល្ចើនេ្មាប់លធវើការ បញ្េូ លតថ្មល និង ផ្េវងរកល្ម េះលភ្ៀវ ជាលែើម ។ លយើងអាចលធវើការ លុបទ្យិនែន័យផ្ែលបាន
បញ្េូ លរួចនឹងអាចផ្កផ្្បទ្យិនែន័យបាននងផ្ែរ។
Figure 6: Form ព័ត៌មានលភ្ៀវ
 From េ្មាប់កត់ចំែងថ្ែលភ្ៀវផ្ែលអលញ្ជើញចូលរួម
លៅកែុង Form លនេះផ្ែរលយើងបានបលងកើតបូតុងបី ListView មួយ រួមទំង មាន Textfield
ចំនួនបីេ្មាប់លធវើការ បញ្េូ លតថ្មល និង ផ្េវងរកល្ម េះលភ្ៀវ ជាលែើម ។ លយើងក៏បានបលងកើតជា Radio Button
េ្មាប់ល្ជើេលរើេយកនូវ្បលភទ្យថ្នចំែងថ្ែមានែូចជា ្បាក់លរៀល ្បាក់ែុោល រ នឹង អំលណាយជាលែើម ែូចបាន
បងាា ញកែុងរូបភាព្សាប់។
Figure 7: Form បញ្េូ លចំែងថ្ែលភ្ៀវ
 From របាយការែ៏
លៅកែុង Form លនេះផ្ែរលយើងបានបលងកើត TextView ជាល្ចើនលែើមបីបងាា ញពីរបាយការែ៏ េរុបថ្ន
មងាលការ។
Figure 8: Form របាយការែ៏
 From អំពីពួកលយើង
លៅកែុង Form លនេះផ្ែរលយើងបានបលងកើត TextView ជាល្ចើនេ្មាប់បងាា ញព័ត៌មានែូចខាងល្កាម។
Figure 9: Form អំពីពួកលយើង
 From ជំនួយ
លៅកែុង Form លនេះផ្ែរលយើងបានបលងកើត TextView ជាល្ចើនេ្មាប់បងាា ញព័ត៌មានែូចខាងល្កាម។
Figure 10: Form ជំនួយ
3. Implement
ចំលពាេះការ Implement លៅលលើកមមវិធីលនេះលោយមានការល្បើ Eclipse IDE ជាជំនួយលធវើឲ្យការេរលេរកូែ
បានកាន់ផ្ត្បលេើរជាងមុន។
 From ែំបូងលពលលបើកកមមវិធី
public frmWelcome() {
setResizable(false);
setUndecorated(true);//Remove Title bar
setLocationRelativeTo(null);
Operators ops=new Operators();
//----- Set Form Center Screen--------
int width=996,height=513;
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
int x = (screen.width - width) / 2;
int y = (screen.height - height) / 2;
setBounds(x, y, width, height);
//------------------------------------
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JButton btnNewButton = new JButton("");
btnNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
System.exit(0);
}
});
btnNewButton.setFont(new Font("Tahoma", Font.PLAIN, 10));
btnNewButton.setBounds(963, 0, 34, 30);
btnNewButton.setIcon(newImageIcon(this.getClass().getResource("/close
.png")));
btnNewButton.setBackground(null);
btnNewButton.setOpaque(false);
btnNewButton.setContentAreaFilled(false);
btnNewButton.setBorderPainted(false);
contentPane.add(btnNewButton);
btnStart=new JButton();
btnStart.setBounds(388, 252, 207, 188);
btnStart.setBackground(null);
btnStart.setOpaque(false);
btnStart.setContentAreaFilled(false);
btnStart.setBorderPainted(false);
btnStart.setIcon(new
ImageIcon(this.getClass().getResource("/btnStart.png")));
btnStart.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
btnStart.setIcon(new
ImageIcon(this.getClass().getResource("/btnStart1.png")));
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
new FrmLogin().setVisible(true);
dispose();
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
btnStart.setIcon(new
ImageIcon(this.getClass().getResource("/btnStart.png")));
}
});
contentPane.add(btnStart);
JButton btnNewButton_1 = new JButton("ជំនួយ");
btnNewButton_1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
new frmHelp().setVisible(true);
}
});
btnNewButton_1.setHorizontalAlignment(SwingConstants.LEFT);
btnNewButton_1.setFont(new Font("Khmer OS Battambang",
Font.PLAIN, 12));
btnNewButton_1.setBounds(907, 30, 61, 30);
contentPane.add(btnNewButton_1);
JLabel lblNewLabel = new JLabel("");
lblNewLabel.setBounds(0, 0, 997, 518);
lblNewLabel.setIcon(new
ImageIcon(this.getClass().getResource("/welcome.png")));
contentPane.add(lblNewLabel);
}
 Form បលងកើតទ្យិនែន័យ
public frmUser() {
setType(Type.POPUP);
setTitle("User Account");
setUndecorated(true);//Remove Title
//----- Set Form Center Screen--------
int width=675,height=470;
Dimension screen =
Toolkit.getDefaultToolkit().getScreenSize();
int x = (screen.width - width) / 2;
int y = (screen.height - height) / 2;
setBounds(x, y, width, height);
//------------------------------------
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JLabel lblNewLabel = new JLabel("កូនប្រុសនាម");
lblNewLabel.setForeground(new Color(210, 105, 30));
lblNewLabel.setFont(new Font("Khmer OS Siemreap", Font.PLAIN,
16));
lblNewLabel.setBounds(51, 242, 94, 34);
contentPane.add(lblNewLabel);
JLabel label = new JLabel("ពាកយសំងាត់");
label.setForeground(new Color(210, 105, 30));
label.setFont(new Font("Khmer OS Siemreap", Font.PLAIN, 16));
label.setBounds(46, 373, 94, 21);
contentPane.add(label);
JLabel label_1 = new JLabel("កូនស្សីនាម");
label_1.setForeground(new Color(210, 105, 30));
label_1.setFont(new Font("Khmer OS Siemreap", Font.PLAIN, 16));
label_1.setBounds(51, 284, 94, 34);
contentPane.add(label_1);
JLabel label_2 = new JLabel("កាលររិច្ឆេទអាពាហ៍ពិពាហ៍");
label_2.setForeground(new Color(210, 105, 30));
label_2.setFont(new Font("Khmer OS Siemreap", Font.PLAIN, 16));
label_2.setBounds(47, 323, 166, 39);
contentPane.add(label_2);
JLabel lblNewLabel_1 = new JLabel("រច្្កើតទិននន័យថ្មី");
lblNewLabel_1.setBackground(new Color(210, 105, 30));
lblNewLabel_1.setForeground(new Color(210, 105, 30));
lblNewLabel_1.setFont(new Font("Khmer OS Muol Light",
Font.PLAIN, 20));
lblNewLabel_1.setBounds(257, 205, 166, 40);
contentPane.add(lblNewLabel_1);
txtGName = new JTextField();
txtGName.setForeground(new Color(0, 0, 255));
txtGName.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
16));
txtGName.setBounds(223, 244, 285, 34);
contentPane.add(txtGName);
txtGName.setColumns(10);
txtBName = new JTextField();
txtBName.setForeground(new Color(0, 0, 255));
txtBName.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
16));
txtBName.setColumns(10);
txtBName.setBounds(223, 284, 285, 35);
contentPane.add(txtBName);
txtWeddingDate = new JTextField();
txtWeddingDate.setFont(new Font("Tahoma", Font.PLAIN, 12));
txtWeddingDate.setColumns(10);
txtWeddingDate.setBounds(223, 325, 285, 35);
contentPane.add(txtWeddingDate);
btnCreate = new JButton("");
btnCreate.setBounds(518, 261, 132, 50);
btnCreate.setOpaque(false);
btnCreate.setContentAreaFilled(false);
btnCreate.setBorderPainted(false);
btnCreate.setIcon(new
ImageIcon(this.getClass().getResource("/btnsave.png")));
btnCreate.addMouseListener(new MouseAdapter() {
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
btnCreate.setIcon(new
ImageIcon(this.getClass().getResource("/btnsave.png")));
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
btnCreate.setIcon(new
ImageIcon(this.getClass().getResource("/btnsave1.png")));
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
String gn="'"+txtGName.getText()+"'";
String bn="'"+txtBName.getText()+"'";
String wd="'"+txtWeddingDate.getText()+"'";
String pw="'"+txtPassword.getText()+"'";
String nm="** សូមរញ្ជូ លច្្ម ោះ";
if (txtGName.getText().equals("")) {
LbMessage.setText(nm + "កូនកំច្ ោះ **");
txtGName.requestFocus();
} else if (txtBName.getText().equals("")) {
LbMessage.setText(nm + "កូនប្កមំ **");
txtBName.requestFocus();
} else if (txtWeddingDate.getText().equals("")) {
LbMessage.setText("សូមរញ្ជូ លថ្ថ្ៃច្រៀរអាពាហ៏ពិពាហ៏..!");
txtWeddingDate.requestFocus();
} else if (txtPassword.getText().equals("")) {
LbMessage.setText("សូមរញ្ជូ លពាកយសំងាត់ច្ ើមបីឆូលច្ប្រើប្ាស់");
txtPassword.requestFocus();
} else {
Operators op = new Operators();
try {
op.SetConnectionSql();
String sql = "Insert Into tbUser
(GroomName,BrideName,WeddingDate, UserPassword) Values(N" + gn
+ ",N" + bn + "," + wd +
"," + pw + ")";
int r = op.stmt.executeUpdate(sql);
if (r == 1) {
LbMessage.setText("សូមអរអរសាទរច្ កអនករច្្កើតទិននន័យានច្ោគជ័យ..!!");
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
});
contentPane.add(btnCreate);
txtPassword = new JPasswordField();
txtPassword.setFont(new Font("Tahoma", Font.PLAIN, 12));
txtPassword.setBounds(223, 366, 285, 35);
contentPane.add(txtPassword);
btnClose = new JButton("");
btnClose.setOpaque(false);
btnClose.setContentAreaFilled(false);
btnClose.setBorderPainted(false);
btnClose.setBounds(518, 322, 132, 50);
btnClose.setIcon(newImageIcon(this.getClass().getResource("/btnExit1.
png")));
btnClose.addMouseListener(new MouseListener() {
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
btnClose.setIcon(new
ImageIcon(this.getClass().getResource("/btnExit1.png")));
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
btnClose.setIcon(new
ImageIcon(this.getClass().getResource("/btnExit.png")));
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
new FrmLogin().setVisible(true);
dispose();
}
});
LbMessage = new JLabel("");
LbMessage.setHorizontalAlignment(SwingConstants.CENTER);
LbMessage.setForeground(new Color(255, 0, 0));
LbMessage.setFont(new Font("Khmer OS Siemreap", Font.PLAIN,
16));
LbMessage.setBounds(163, 412, 402, 34);
contentPane.add(LbMessage);
contentPane.add(btnClose);
JLabel label_3 = new JLabel("");
label_3.setFont(new Font("Khmer OS Siemreap", Font.PLAIN, 16));
label_3.setBounds(0, 0, 675, 471);
label_3.setIcon(new
ImageIcon(this.getClass().getResource("/BackUser.png")));
contentPane.add(label_3);
}
 Form េ្មាប់ចូលល្បើ្បាេ់កមមវិធី
public FrmLogin() {
setType(Type.POPUP);
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//----- Set Form Center Screen--------
int width=468,height=339;
Dimension screen =
Toolkit.getDefaultToolkit().getScreenSize();
int x = (screen.width - width) / 2;
int y = (screen.height - height) / 2;
setBounds(x, y, 468, 340);
//------------------------------------
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
txtPassLogin = new JPasswordField();
txtPassLogin.setOpaque(false);
//passwordField.setContentAreaFilled(false);
//passwordField.setBorderPainted(false);
txtPassLogin.setFont(new Font("Tahoma", Font.PLAIN, 20));
txtPassLogin.setBounds(38, 187, 377, 38);
contentPane.add(txtPassLogin);
btnLogin= new JButton("");
btnLogin.setOpaque(false);
btnLogin.setContentAreaFilled(false);
btnLogin.setBorderPainted(false);
btnLogin.setIcon(new
ImageIcon(this.getClass().getResource("/btnlogin.png")));
btnLogin.addMouseListener(new MouseAdapter() {
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
btnLogin.setIcon(new
ImageIcon(this.getClass().getResource("/btnlogin.png")));
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
btnLogin.setIcon(new
ImageIcon(this.getClass().getResource("/btnlogin1.png")));
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
if (n == 5) {
JOptionPane.showMessageDialog(null,
"Goodbye!");
System.exit(0);
} else {
if (txtPassLogin.getText().equals("")) {
LbMessage.setText("រញ្ជូ លពាកយសំងាត់..!!");
txtPassLogin.requestFocus();
n = n + 1;
} else {
if
(txtPassLogin.getText().equals(txtPass.getText())) {
LbMessage.setText("");
new FrmManu().setVisible(true);
dispose();
} else {
LbMessage.setText("រញ្ជូ លពាកយសំងាត់ខស សូមពាយាមមដ្ច្ទៀត!");
LbMessage.requestFocus();
n = n + 1;
}
}
}
}
});
btnLogin.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
18));
btnLogin.setBounds(38, 235, 136, 44);
contentPane.add(btnLogin);
LbMessage = new JLabel("");
LbMessage.setHorizontalAlignment(SwingConstants.CENTER);
LbMessage.setForeground(Color.RED);
LbMessage.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
13));
LbMessage.setBounds(38, 278, 377, 33);
contentPane.add(LbMessage);
btnCreate = new JButton("");
btnCreate.setOpaque(false);
btnCreate.setEnabled(true);
btnCreate.setContentAreaFilled(false);
btnCreate.setBorderPainted(false);
btnCreate.setBounds(279, 235, 130, 44);
btnCreate.setIcon(new
ImageIcon(this.getClass().getResource("/btnCreate.png")));
btnCreate.addMouseListener(new MouseAdapter() {
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
btnCreate.setIcon(new
ImageIcon(this.getClass().getResource("/btnCreate.png")));
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
btnCreate.setIcon(new
ImageIcon(this.getClass().getResource("/btncreate1.png")));
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
new frmUser().setVisible(true);
dispose();
}
});
contentPane.add(btnCreate);
JLabel label = new JLabel("");
label.setBounds(0, 0, 457, 311);
label.setIcon(new
ImageIcon(this.getClass().getResource("/login.png")));
contentPane.add(label);
txtPass = new JTextField();
txtPass.setVisible(false);
txtPass.setBounds(10, 118, 102, 20);
contentPane.add(txtPass);
txtPass.setColumns(10);
String sql="Select UserPassword from tbUser";
Operators op=new Operators();
try {
op.SetConnectionSql();
op.rs=op.stmt.executeQuery(sql);
while(op.rs.next()){
btnCreate.setEnabled(false);
txtPass.setText(op.rs.getString(1));
txtPass.setVisible(false);
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
 Form Main
public FrmManu() {
setUndecorated(true);// Remove Title bar
setResizable(false);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
//----- Set Form Center Screen--------
int width=1383,height=780;
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
int x = (screen.width - width) / 2;
int y = (screen.height - height) / 2;
setBounds(x, y, width, height);
contentPane.setLayout(null);
JButton btnExit = new JButton("");
btnExit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
dispose();
}
});
JButton button = new JButton("");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});
btnExit.setBounds(1312, 723, 49, 57);
btnExit.setOpaque(false);
btnExit.setContentAreaFilled(false);
btnExit.setBorderPainted(false);
btnExit.setIcon(new
ImageIcon(this.getClass().getResource("/Exit.png")));
contentPane.add(btnExit);
JLabel label_1 = new JLabel("ព័ត៌មានអនកច្ប្រើប្ាស់");
label_1.setBackground(Color.MAGENTA);
label_1.setForeground(Color.BLUE);
label_1.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20));
label_1.setBounds(134, 403, 220, 51);
contentPane.add(label_1);
btnNewButton = new JButton("");
btnNewButton.setBounds(166, 229, 162, 177);
btnNewButton.setIcon(new
ImageIcon(this.getClass().getResource("/user5.png")));
btnNewButton.setOpaque(false);
btnNewButton.setContentAreaFilled(false);
btnNewButton.setBorderPainted(false);
btnNewButton.addMouseListener(new MouseListener() {
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
btnNewButton.setIcon(new
ImageIcon(this.getClass().getResource("/user5.png")));
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
btnNewButton.setIcon(new
ImageIcon(this.getClass().getResource("/user3.png")));
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
new frmUserUpdate().setVisible(true);
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
});
contentPane.add(btnNewButton);
btnGuest = new JButton("");
btnGuest.setOpaque(false);
btnGuest.setContentAreaFilled(false);
btnGuest.setBorderPainted(false);
btnGuest.setBounds(1023, 235, 162, 177);
btnGuest.setIcon(new
ImageIcon(this.getClass().getResource("/guest.png")));
btnGuest.addMouseListener(new MouseListener() {
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
btnGuest.setIcon(new
ImageIcon(this.getClass().getResource("/guest.png")));
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
btnGuest.setIcon(new
ImageIcon(this.getClass().getResource("/guest1.png")));
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
new frmGuestUpdate().setVisible(true);
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
});
contentPane.add(btnGuest);
JLabel label_2 = new JLabel("ព័ត៌មានច្្ញៀវឆូលរួម");
label_2.setForeground(Color.BLUE);
label_2.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20));
label_2.setBackground(Color.MAGENTA);
label_2.setBounds(1023, 409, 213, 57);
contentPane.add(label_2);
btnInvite = new JButton("");
btnInvite.setOpaque(false);
btnInvite.setContentAreaFilled(false);
btnInvite.setBorderPainted(false);
btnInvite.setBounds(618, 229, 162, 177);
btnInvite.setIcon(new
ImageIcon(this.getClass().getResource("/invite2.png")));
btnInvite.addMouseListener(new MouseListener() {
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
btnInvite.setIcon(new
ImageIcon(this.getClass().getResource("/invite2.png")));
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
btnInvite.setIcon(new
ImageIcon(this.getClass().getResource("/invite1.png")));
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
new frmGuest().setVisible(true);
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
});
contentPane.add(btnInvite);
JLabel label_3 = new JLabel("ព័ត៌មានអច្ញ្ជ ើញច្្ញៀវ");
label_3.setForeground(Color.BLUE);
label_3.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20));
label_3.setBackground(Color.MAGENTA);
label_3.setBounds(607, 404, 220, 51);
contentPane.add(label_3);
btnReport = new JButton("");
btnReport.setOpaque(false);
btnReport.setContentAreaFilled(false);
btnReport.setBorderPainted(false);
btnReport.setBounds(166, 465, 162, 177);
btnReport.setIcon(new
ImageIcon(this.getClass().getResource("/report.png")));
btnReport.addMouseListener(new MouseListener() {
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
btnReport.setIcon(new
ImageIcon(this.getClass().getResource("/report.png")));
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
btnReport.setIcon(new
ImageIcon(this.getClass().getResource("/report1.png")));
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
new frmReport().setVisible(true);
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
});
contentPane.add(btnReport);
JLabel label_4 = new JLabel("រាយការណ៏ សររ");
label_4.setForeground(Color.BLUE);
label_4.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20));
label_4.setBackground(Color.MAGENTA);
label_4.setBounds(159, 644, 195, 57);
contentPane.add(label_4);
JLabel label_5 = new
JLabel("កមមវិធីកត់ប្ាឆំណ្ថ្ អាពាហ៏ពិពាហ៏ច្នោះរច្្កើតច្ ើ្ច្ោយប្កុមនិសិតសថ្នសាកលវិទាល័យ្ូមិ
នទ្នំច្ពញ ជំនាន់ទី ១៧ ឆ្ន ំ ២០១៦");
label_5.setForeground(new Color(0, 0, 205));
label_5.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20));
label_5.setBackground(Color.MAGENTA);
label_5.setBounds(30, 732, 1272, 37);
contentPane.add(label_5);
JLabel label_6 = new JLabel("អំពីពួកច្យើ្");
label_6.setForeground(Color.BLUE);
label_6.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20));
label_6.setBackground(Color.MAGENTA);
label_6.setBounds(651, 650, 142, 57);
contentPane.add(label_6);
btnAbout = new JButton("");
btnAbout.setOpaque(false);
btnAbout.setContentAreaFilled(false);
btnAbout.setBorderPainted(false);
btnAbout.setBounds(625, 471, 162, 177);
btnAbout.setIcon(new
ImageIcon(this.getClass().getResource("/about1.png")));
btnAbout.addMouseListener(new MouseListener() {
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
btnAbout.setIcon(new
ImageIcon(this.getClass().getResource("/about1.png")));
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
btnAbout.setIcon(new
ImageIcon(this.getClass().getResource("/about.png")));
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
new frmAbout().setVisible(true);
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
});
contentPane.add(btnAbout);
JLabel label_7 = new JLabel("ជំនួយ");
label_7.setForeground(Color.BLUE);
label_7.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20));
label_7.setBackground(Color.MAGENTA);
label_7.setBounds(1075, 664, 130, 57);
contentPane.add(label_7);
btnHelp = new JButton("");
btnHelp.setOpaque(false);
btnHelp.setContentAreaFilled(false);
btnHelp.setBorderPainted(false);
btnHelp.setBounds(1033, 485, 162, 177);
btnHelp.setIcon(new
ImageIcon(this.getClass().getResource("/help.png")));
btnHelp.addMouseListener(new MouseListener() {
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
btnHelp.setIcon(new
ImageIcon(this.getClass().getResource("/help.png")));
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
btnHelp.setIcon(new
ImageIcon(this.getClass().getResource("/help1.png")));
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
new frmHelp().setVisible(true);
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
});
contentPane.add(btnHelp);
JLabel LbGName = new JLabel("ព័ត៌មានអច្ញ្ជ ើញច្្ញៀវ");
LbGName.setHorizontalAlignment(SwingConstants.RIGHT);
LbGName.setForeground(new Color(255, 255, 255));
LbGName.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20));
LbGName.setBackground(Color.MAGENTA);
LbGName.setBounds(397, 100, 220, 51);
contentPane.add(LbGName);
JLabel LbBrName = new JLabel("ព័ត៌មានអច្ញ្ជ ើញច្្ញៀវ");
LbBrName.setHorizontalAlignment(SwingConstants.LEFT);
LbBrName.setForeground(new Color(255, 255, 255));
LbBrName.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20));
LbBrName.setBackground(Color.MAGENTA);
LbBrName.setBounds(771, 100, 220, 51);
contentPane.add(LbBrName);
JLabel LbDate = new JLabel("ព័ត៌មានអច្ញ្ជ ើញច្្ញៀវ");
LbDate.setHorizontalAlignment(SwingConstants.RIGHT);
LbDate.setForeground(Color.WHITE);
LbDate.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20));
LbDate.setBackground(Color.MAGENTA);
LbDate.setBounds(1135, 100, 207, 51);
contentPane.add(LbDate);
JLabel LbWeddingDate = new JLabel("ព័ត៌មានអច្ញ្ជ ើញច្្ញៀវ");
LbWeddingDate.setForeground(Color.WHITE);
LbWeddingDate.setFont(new Font("Khmer OS Muol", Font.PLAIN,
20));
LbWeddingDate.setBackground(Color.MAGENTA);
LbWeddingDate.setBounds(51, 100, 220, 51);
contentPane.add(LbWeddingDate);
JLabel label_8 = new JLabel("ថ្ថ្ៃច្រៀរអាពាហ៏ពិពាហ៏");
label_8.setForeground(Color.WHITE);
label_8.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20));
label_8.setBackground(Color.MAGENTA);
label_8.setBounds(41, 59, 226, 51);
contentPane.add(label_8);
JLabel label_10 = new JLabel("ថ្ថ្ៃច្នោះ");
label_10.setForeground(Color.WHITE);
label_10.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20));
label_10.setBackground(Color.MAGENTA);
label_10.setBounds(1242, 59, 100, 51);
contentPane.add(label_10);
JLabel label = new JLabel("");
label.setIcon(new
ImageIcon(this.getClass().getResource("/MainForm.png")));
label.setBounds(0, 0, 1378, 780);
contentPane.add(label);
//---------======
dateFormat = new SimpleDateFormat("dd-MMM-YYYY");
Calendar cal = Calendar.getInstance();
LbDate.setText(dateFormat.format(cal.getTime())); //2014/08/06
//=========Select Groom and BrideName
Operators op=new Operators();
String sql="Select * from tbUser";
try {
op.SetConnectionSql();
op.rs=op.stmt.executeQuery(sql);
while(op.rs.next()){
LbGName.setText(op.rs.getString(2));
LbBrName.setText(op.rs.getString(3));
LbWeddingDate.setText(op.rs.getString(4));
String text=LbWeddingDate.getText();
DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
// Date today = df.parse("20/12/2005");
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
 Form េ្មាប់ផ្កផ្្បព័ត៌មានអែកល្បើ្បាេ់
public frmUserUpdate() {
setType(Type.POPUP);
setUndecorated(true);//Remove Title
//----- Set Form Center Screen--------
int width=683,height=502;
Dimension screen =
Toolkit.getDefaultToolkit().getScreenSize();
int x = (screen.width - width) / 2;
int y = (screen.height - height) / 2;
setBounds(x, y, 677, 482);
//------------------------------------
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JLabel lblNewLabel = new JLabel("កូនប្រុសនាម ");
lblNewLabel.setForeground(new Color(210, 105, 30));
lblNewLabel.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
14));
lblNewLabel.setBounds(33, 251, 94, 25);
contentPane.add(lblNewLabel);
lbPass = new JLabel("ពាកយសំងាត់ចាស់");
lbPass.setForeground(new Color(210, 105, 30));
lbPass.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
14));
lbPass.setBounds(33, 341, 94, 25);
contentPane.add(lbPass);
JLabel label_1 = new JLabel("កូនស្សីនាម");
label_1.setForeground(new Color(210, 105, 30));
label_1.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
14));
label_1.setBounds(33, 281, 94, 25);
contentPane.add(label_1);
JLabel label_2 = new JLabel("កាលររិច្ឆជទអាពាហ៍ពិពាហ៍");
label_2.setForeground(new Color(210, 105, 30));
label_2.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
14));
label_2.setBounds(33, 311, 166, 26);
contentPane.add(label_2);
JLabel lblNewLabel_1 = new JLabel("ព័ត៌មានររស់អនកច្ប្រើប្ាស់");
lblNewLabel_1.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel_1.setForeground(new Color(210, 105, 30));
lblNewLabel_1.setFont(new Font("Khmer OS Muol Light",
Font.PLAIN, 20));
lblNewLabel_1.setBounds(185, 209, 318, 40);
contentPane.add(lblNewLabel_1);
txtGName = new JTextField();
txtGName.setFont(new Font("Khmer OS", Font.PLAIN, 11));
txtGName.setBounds(185, 251, 318, 26);
contentPane.add(txtGName);
txtGName.setColumns(10);
txtBName = new JTextField();
txtBName.setFont(new Font("Khmer OS", Font.PLAIN, 11));
txtBName.setColumns(10);
txtBName.setBounds(185, 281, 318, 27);
contentPane.add(txtBName);
txtWeddingDate = new JTextField();
txtWeddingDate.setColumns(10);
txtWeddingDate.setBounds(185, 311, 318, 27);
contentPane.add(txtWeddingDate);
txtNewPassword = new JPasswordField();
txtNewPassword.setBounds(185, 373, 318, 27);
contentPane.add(txtNewPassword);
LbNewPass = new JLabel("ពាកយសំងាត់ថ្មី");
LbNewPass.setForeground(new Color(210, 105, 30));
LbNewPass.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
14));
LbNewPass.setBounds(33, 377, 94, 23);
contentPane.add(LbNewPass);
txtConfirmPassword = new JPasswordField();
txtConfirmPassword.setBounds(185, 404, 318, 27);
contentPane.add(txtConfirmPassword);
lbConPass = new JLabel("រញ្ជជ ក់ពាកយសំងាត់ថ្មី");
lbConPass.setForeground(new Color(210, 105, 30));
lbConPass.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
14));
lbConPass.setBounds(33, 404, 142, 27);
contentPane.add(lbConPass);
checkBox = new JCheckBox("រដូរពាកយសំងាត់");
checkBox.setBackground(new Color(245, 245, 245));
checkBox.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
15));
checkBox.setBounds(523, 355, 108, 43);
checkBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
if(checkBox.isSelected()==true){
SetVisibleButton(true);
}
else
SetVisibleButton(false);
}
});
contentPane.add(checkBox);
txtPassword = new JPasswordField();
txtPassword.setColumns(10);
txtPassword.setBounds(185, 341, 318, 27);
contentPane.add(txtPassword);
btnSave= new JButton("");
btnSave.setOpaque(false);
btnSave.setContentAreaFilled(false);
btnSave.setBorderPainted(false);
btnSave.setIcon(new
ImageIcon(this.getClass().getResource("/btnsave.png")));
btnSave.setBounds(513, 251, 132, 46);
btnSave.addMouseListener(new MouseListener() {
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
btnSave.setIcon(new
ImageIcon(this.getClass().getResource("/btnsave.png")));
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
btnSave.setIcon(new
ImageIcon(this.getClass().getResource("/btnsave1.png")));
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
String gn,bn,wd,pw,oldPw,NewPassw,NewConf;
gn="'"+txtGName.getText()+"'";
bn="'"+txtBName.getText()+"'";
wd="'"+txtWeddingDate.getText()+"'";
pw="'"+txtPassword.getText()+"'";
oldPw="'"+textoldPass.getText()+"'";
NewPassw="'"+txtNewPassword.getText()+"'";
NewConf="'"+txtConfirmPassword.getText()+"'";
String id="'"+textid.getText()+"'";
if(checkBox.isSelected()==true){
if(pw.equals(oldPw)){
if(NewPassw.equals(NewConf)){
sql="Update tbUser set
GroomName=N"+ gn +", BrideName=N"+ bn+", WeddingDate="+wd+",
UserPassword="+NewPassw +" where UserID="+id;
ops.updateData(sql);
}
else
JOptionPane.showMessageDialog(null,"Confirm New Password id wrong!");
}
else
JOptionPane.showMessageDialog(null,"Wrong Old Password id wrong!");
}
else
{
// if they only want to change Name and
WeddingDate
sql="Update tbUser set GroomName=N"+ gn +",
BrideName=N"+ bn+", WeddingDate="+wd+" where UserID="+id;
ops.updateData(sql);
}
}
});
contentPane.add(btnSave);
btnExit = new JButton("");
btnExit.setOpaque(false);
btnExit.setContentAreaFilled(false);
btnExit.setBorderPainted(false);
btnExit.setBounds(513, 302, 132, 46);
btnExit.setIcon(new
ImageIcon(this.getClass().getResource("/btnExit1.png")));
btnExit.addMouseListener(new MouseListener() {
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
btnExit.setIcon(new
ImageIcon(this.getClass().getResource("/btnExit1.png")));
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
btnExit.setIcon(new
ImageIcon(this.getClass().getResource("/btnExit.png")));
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
dispose();
}
});
contentPane.add(btnExit);
JLabel label_3 = new JLabel("");
label_3.setBounds(0, -11, 688, 507);
label_3.setIcon(new
ImageIcon(this.getClass().getResource("/Backuser.png")));
contentPane.add(label_3);
textid = new JTextField();
textid.setBounds(536, 380, 86, 20);
contentPane.add(textid);
textid.setColumns(10);
textoldPass = new JTextField();
textoldPass.setBounds(536, 407, 86, 20);
contentPane.add(textoldPass);
textoldPass.setColumns(10);
///==========Get Data to TextField====================
try {
ops.SetConnectionSql();
sql="select * from tbUser";
ops.rs=ops.stmt.executeQuery(sql);
while(ops.rs.next()){
txtGName.setText(ops.rs.getString(2));
txtBName.setText(ops.rs.getString(3));
txtWeddingDate.setText(ops.rs.getString(4));
textid.setText(ops.rs.getString(1));
textoldPass.setText(ops.rs.getString(5));
}
ops.rs.close();
ops.stmt.close();
// ops.con.close();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
//=====================================================
SetVisibleButton(false);///Call function
}
public void SetVisibleButton(boolean b) {
txtPassword.setVisible(b);
txtNewPassword.setVisible(b);
txtConfirmPassword.setVisible(b);
lbPass.setVisible(b);
lbConPass.setVisible(b);
LbNewPass.setVisible(b);;
textid.setVisible(false);
textoldPass.setVisible(false);
}
 Form េ្មាប់បញ្េូ លព័ត៌មានលភ្ៀវផ្ែល្តូវអលញ្ជើញ
public frmGuest() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 1180, 619);
setLocationRelativeTo(null);
setUndecorated(true);
contentPane = new JPanel();
contentPane.setForeground(Color.BLACK);
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
addWindowListener(this);
JLabel lbName = new JLabel("ច្្ម ោះច្្ញៀវ");
lbName.setForeground(new Color(153, 50, 204));
lbName.setFont(new Font("Khmer OS Muol Light", Font.BOLD, 14));
lbName.setBounds(20, 278, 94, 29);
contentPane.add(lbName);
txtName = new JTextField();
txtName.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent arg0) {
if(txtName.getText()!="")lbMess.setText("");
}
});
txtName.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
14));
txtName.setBounds(154, 278, 228, 32);
contentPane.add(txtName);
txtName.setColumns(10);
JLabel lbTitle = new JLabel("ងារ");
lbTitle.setForeground(new Color(153, 50, 204));
lbTitle.setFont(new Font("Khmer OS Muol Light", Font.BOLD,
14));
lbTitle.setBounds(20, 324, 94, 29);
contentPane.add(lbTitle);
lbAddress = new JLabel("អាស័យោា ន");
lbAddress.setForeground(new Color(153, 50, 204));
lbAddress.setFont(new Font("Khmer OS Muol Light", Font.BOLD,
14));
lbAddress.setBounds(20, 363, 94, 29);
contentPane.add(lbAddress);
txtAddress = new JTextArea();
txtAddress.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
if(txtAddress.getText()!="")lbMess.setText("");
}
});
txtAddress.setWrapStyleWord(true);
txtAddress.setLineWrap(true);
txtAddress.setColumns(1);
txtAddress.setRows(3);
txtAddress.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
14));
txtAddress.setBounds(154, 364, 228, 85);
contentPane.add(txtAddress);
cboTitle = new JComboBox();
cboTitle.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent arg0) {
lbMess.setText("");
}
});
cboTitle.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
14));
cboTitle.setModel(new DefaultComboBoxModel(new String[]
{"សច្មដឆ", "ឯកឧតដម", "ច្ កជំទាវ", "ច្ កឧកញ៉ា ", "អនកឧកញ៉ា ", "ច្ ក",
"ច្ កស្សី", "អនកនា្", "កញ្ជា "}));
cboTitle.setBounds(154, 321, 228, 32);
cboTitle.setSelectedIndex(-1);
contentPane.add(cboTitle);
JPanel panel = new JPanel();
panel.setBackground(new Color(224, 255, 255));
 panel.setForeground(new Color(127, 255, 212));
 panel.setBounds(430, 211, 729, 386);
contentPane.add(panel);
panel.setLayout(null);
model=new DefaultTableModel();
model.addColumn("កូ ");
model.addColumn("ច្្ម ោះ");
model.addColumn("ងារ");
model.addColumn("អាស័យោា ន");
tbGuest = new JTable(model);
tbGuest.getColumnModel().getColumn(0).setMinWidth(0);
tbGuest.getColumnModel().getColumn(0).setMaxWidth(0);
tbGuest.getColumnModel().getColumn(0).setWidth(0);
tbGuest.setRowHeight(25);
tbGuest.getTableHeader().setFont(new Font("Khmer OS Muol
Light", Font.PLAIN, 18));
tbGuest.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
14));
tbGuest.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
getID=(int)
tbGuest.getValueAt(tbGuest.getSelectedRow(), 0);
String nm=(String)
tbGuest.getValueAt(tbGuest.getSelectedRow(), 1);
String ti=(String)
tbGuest.getValueAt(tbGuest.getSelectedRow(), 2);
String ad=(String)
tbGuest.getValueAt(tbGuest.getSelectedRow(), 3);
txtName.setText(nm);
cboTitle.setSelectedItem(ti);
txtAddress.setText(ad);
lbMess.setText("");
status="Old";
enabledButton(true);
}
});
int v = ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
int h = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
jsp=new JScrollPane(tbGuest,v,h);
jsp.setBounds(20, 54, 690, 317);
panel.add(jsp);
txtSearch = new JTextField();
txtSearch.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
try{
int rc= model.getRowCount();
for(int j = 0;j<rc;j++){
model.removeRow(0);
}
String sql="Select * From tbGuest Where Name Like
N'%"+ txtSearch.getText() + "%'"+"Collate Khmer_100_Bin";
try {
rs=stmt.executeQuery(sql);
while(rs.next()){
int code=rs.getInt(1);
String nm=rs.getString(2);
String ti=rs.getString(3);
String ad=rs.getString(4);
Object[] obj={code,nm,ti,ad};
model.addRow(obj);
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
getID=(int) tbGuest.getValueAt(0, 0);
String nm=(String) tbGuest.getValueAt(0, 1);
String ti=(String) tbGuest.getValueAt(0, 2);
String ad=(String) tbGuest.getValueAt(0, 3);
txtName.setText(nm);
cboTitle.setSelectedItem(ti);
txtAddress.setText(ad);
enabledButton(true);
}catch(Exception exc){}
}
});
txtSearch.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
14));
txtSearch.setColumns(10);
txtSearch.setBounds(354, 11, 226, 32);
panel.add(txtSearch);
JLabel lbSearch = new JLabel("ស្សែ្រកាមច្្ម ោះ");
lbSearch.setForeground(new Color(255, 0, 255));
lbSearch.setFont(new Font("Khmer OS Fasthand", Font.BOLD, 15));
lbSearch.setBounds(162, 12, 158, 29);
panel.add(lbSearch);
btnSave = new JButton("");
btnSave.setBounds(138, 503, 85, 35);
btnSave.setOpaque(false);
btnSave.setContentAreaFilled(false);
btnSave.setBorderPainted(false);
btnSave.setIcon(new
ImageIcon(this.getClass().getResource("/btnSave2.png")));
btnSave.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
if (txtName.getText().equals("")) {
lbMess.setText("សួមរញ្ជូ លច្្ម ោះច្្ញៀវ..!");
txtName.requestFocus();
} else if (cboTitle.getSelectedItem()==null) {
lbMess.setText("សួមរញ្ជូ លងារររស់ច្្ញៀវ..!");
cboTitle.requestFocus();
} else if (txtAddress.getText().equals("")) {
lbMess.setText("សួមរញ្ជូ លអស័យោា នររស់ច្្ញៀវ..!");
txtAddress.requestFocus();
} else {
String nm="'"+txtName.getText()+"'";
String ti="'"+cboTitle.getSelectedItem()+"'";
String ad="'"+txtAddress.getText()+"'";
if(status.equals("New"))
{
String sql="Insert Into tbGuest
(Name,Title,Address) Values(N"+ nm+",N"+ ti+",N"+ad+")";
int r=0;
try {
r = stmt.executeUpdate(sql);
} catch (SQLException e1) {
// TODO Auto-generated catch
block
e1.printStackTrace();
}
if(r==1){
lbMess.setText("អរ់អរសាទរ!
ច្ កអនករញ្ជូ លទិននន័យានច្ោគជ័យ..!");
int rc= model.getRowCount();
for(int i = 0;i<rc;i++){
model.removeRow(0);
}
windowOpened(null);
}
}
else if(status.equals("Old")){
String sql="Update tbGuest Set
Name=N"+nm+", Title=N"+ti+", Address=N"+ad+" Where Code="+ getID;
int r=0;
try {
r = stmt.executeUpdate(sql);
} catch (SQLException e1) {
// TODO Auto-generated catch
block
e1.printStackTrace();
}
if(r==1){
lbMess.setText("អរ់អរសាទរ!
ច្ កអនកានស្កស្ប្រទិននន័យានច្ោគជ័យ..!");
int rc= model.getRowCount();
for(int i = 0;i<rc;i++){
model.removeRow(0);
}
windowOpened(null);
}
}
}
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
btnSave.setIcon(new
ImageIcon(this.getClass().getResource("/btnSave3.png")));
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
btnSave.setIcon(new
ImageIcon(this.getClass().getResource("/btnSave2.png")));
}
});
contentPane.add(btnSave);
btnNew = new JButton("");
btnNew.setBounds(254, 503, 85, 35);
btnNew.setOpaque(false);
btnNew.setContentAreaFilled(false);
btnNew.setBorderPainted(false);
btnNew.setIcon(new
ImageIcon(this.getClass().getResource("/btnNew.png")));
btnNew.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
clearData();
status="New";
txtName.requestFocus();
enabledButton(true);
lbMess.setText("");
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
btnNew.setIcon(new
ImageIcon(this.getClass().getResource("/btnNew1.png")));
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
btnNew.setIcon(new
ImageIcon(this.getClass().getResource("/btnNew.png")));
}
});
contentPane.add(btnNew);
btnDelete = new JButton("");
btnDelete.setBounds(138, 549, 85, 35);
btnDelete.setOpaque(false);
btnDelete.setContentAreaFilled(false);
btnDelete.setBorderPainted(false);
btnDelete.setIcon(new
ImageIcon(this.getClass().getResource("/btnDelete.png")));
btnDelete.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
int i=0;
i=JOptionPane.showConfirmDialog(null, "Do you want
to close?");
if(i==0){
String sql="Delete From tbGuest Where
Code="+getID;
int r=0;
try {
r = stmt.executeUpdate(sql);
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
if(r==1){
lbMess.setText("ច្ កអនកលរទិននន័យានច្ោគជ័យ..!!");
int rc= model.getRowCount();
for(int j = 0;j<rc;j++){
model.removeRow(0);
}
clearData();
windowOpened(null);
}
}
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
btnDelete.setIcon(new
ImageIcon(this.getClass().getResource("/btnDelete1.png")));
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
btnDelete.setIcon(new
ImageIcon(this.getClass().getResource("/btnDelete.png")));
}
});
contentPane.add(btnDelete);
btnExit = new JButton("");
btnExit.setBounds(254, 549, 85, 35);
btnExit.setOpaque(false);
btnExit.setContentAreaFilled(false);
btnExit.setBorderPainted(false);
btnExit.setIcon(new
ImageIcon(this.getClass().getResource("/btnExit2.png")));
btnExit.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
dispose();
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
btnExit.setIcon(new
ImageIcon(this.getClass().getResource("/btnExit3.png")));;
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
btnExit.setIcon(new
ImageIcon(this.getClass().getResource("/btnExit2.png")));
}
});
btnExit.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
14));
contentPane.add(btnExit);
label = new JLabel("សូមរញ្ចូ លពត័មានររស់ច្្ញៀវ");
label.setForeground(new Color(0, 255, 0));
label.setFont(new Font("Khmer OS Muol Light", Font.BOLD, 22));
label.setBounds(46, 227, 336, 51);
contentPane.add(label);
lbGroom = new JLabel("New label");
lbGroom.setHorizontalAlignment(SwingConstants.CENTER);
lbGroom.setForeground(Color.ORANGE);
lbGroom.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
18));
lbGroom.setBounds(397, 135, 126, 29);
contentPane.add(lbGroom);
lbBride = new JLabel("New label");
lbBride.setHorizontalAlignment(SwingConstants.CENTER);
lbBride.setForeground(Color.ORANGE);
lbBride.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
18));
lbBride.setBounds(650, 135, 126, 29);
contentPane.add(lbBride);
lbMess = new JLabel("");
lbMess.setForeground(Color.RED);
lbMess.setHorizontalAlignment(SwingConstants.CENTER);
lbMess.setFont(new Font("Khmer OS Bokor", Font.PLAIN, 14));
lbMess.setBounds(46, 460, 336, 32);
contentPane.add(lbMess);
JLabel lbPicture = new JLabel("New label");
lbPicture.setBounds(0, 0, 1179, 619);
contentPane.add(lbPicture);
lbPicture.setIcon(new
ImageIcon(this.getClass().getResource("/BGuest.png")));
setVisible(true);
}
 Form េ្មាប់កត់ចំែងថ្ែលភ្ៀវផ្ែលអលញ្ជើញចូលរួម
public frmGuestUpdate() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 1180, 619);
setLocationRelativeTo(null);
setUndecorated(true);
contentPane = new JPanel();
contentPane.setForeground(Color.BLACK);
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
addWindowListener(this);
JLabel lbName = new JLabel("ច្្ម ោះច្្ញៀវ :");
lbName.setForeground(new Color(153, 50, 204));
lbName.setFont(new Font("Khmer OS Muol Light", Font.BOLD, 14));
lbName.setBounds(36, 243, 94, 29);
contentPane.add(lbName);
JLabel lbTitle = new JLabel("ងារ :");
lbTitle.setForeground(new Color(153, 50, 204));
lbTitle.setFont(new Font("Khmer OS Muol Light", Font.BOLD,
14));
lbTitle.setBounds(36, 285, 94, 29);
contentPane.add(lbTitle);
lbAddress = new JLabel("អាស័យោា ន :");
lbAddress.setForeground(new Color(153, 50, 204));
lbAddress.setFont(new Font("Khmer OS Muol Light", Font.BOLD,
14));
lbAddress.setBounds(36, 326, 94, 29);
contentPane.add(lbAddress);
JPanel panel = new JPanel();
panel.setBackground(new Color(224, 255, 255));
panel.setForeground(new Color(127, 255, 212));
panel.setBounds(430, 211, 729, 386);
contentPane.add(panel);
panel.setLayout(null);
model=new DefaultTableModel();
model.addColumn("កូ ");
model.addColumn("ច្្ម ោះ");
model.addColumn("ងារ");
model.addColumn("អាស័យោា ន");
model.addColumn("ប្ាក់ច្រៀល");
model.addColumn("ប្ាក់ ា រ");
model.addColumn("កា ូរ");
tbGuest = new JTable(model);
tbGuest.getColumnModel().getColumn(0).setMinWidth(0);
tbGuest.getColumnModel().getColumn(0).setMaxWidth(0);
tbGuest.getColumnModel().getColumn(0).setWidth(0);
tbGuest.setRowHeight(25);
tbGuest.getTableHeader().setFont(new Font("Khmer OS Muol
Light", Font.PLAIN, 18));
tbGuest.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
14));
tbGuest.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
getID=(int)
tbGuest.getValueAt(tbGuest.getSelectedRow(), 0);
String nm=(String)
tbGuest.getValueAt(tbGuest.getSelectedRow(), 1);
String ti=(String)
tbGuest.getValueAt(tbGuest.getSelectedRow(), 2);
String ad=(String)
tbGuest.getValueAt(tbGuest.getSelectedRow(), 3);
txtName.setText(nm);
cboTitle.setText(ti);
txtAddress.setText(ad);
LbMessage.setText("");
enabledButton(true);
}
});
int v = ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
int h = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
jsp=new JScrollPane(tbGuest,v,h);
jsp.setBounds(10, 54, 709, 317);
panel.add(jsp);
txtSearch = new JTextField();
txtSearch.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
try{
int rc= model.getRowCount();
for(int j = 0;j<rc;j++){
model.removeRow(0);
}
String sql="Select * From tbGuest Where Name Like
N'%"+ txtSearch.getText() + "%'"+"Collate Khmer_100_Bin";
try {
rs=stmt.executeQuery(sql);
while(rs.next()){
int code=rs.getInt(1);
String nm=rs.getString(2);
String ti=rs.getString(3);
String ad=rs.getString(4);
Double riels=rs.getDouble(5);
Double dollars=rs.getDouble(6);
String gift=rs.getString(7);
Object[]
obj={code,nm,ti,ad,riels,dollars,gift};
model.addRow(obj);
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
getID=(int) tbGuest.getValueAt(0, 0);
String nm=(String) tbGuest.getValueAt(0, 1);
String ti=(String) tbGuest.getValueAt(0, 2);
String ad=(String) tbGuest.getValueAt(0, 3);
txtName.setText(nm);
cboTitle.setText(ti);
txtAddress.setText(ad);
enabledButton(true);
LbMessage.setText("");
}catch(Exception exc){}
}
});
txtSearch.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
14));
txtSearch.setColumns(10);
txtSearch.setBounds(354, 11, 226, 32);
panel.add(txtSearch);
JLabel lbSearch = new JLabel("ស្សែ្រកាមច្្ម ោះ");
lbSearch.setForeground(new Color(255, 0, 255));
lbSearch.setFont(new Font("Khmer OS Fasthand", Font.BOLD, 15));
lbSearch.setBounds(162, 12, 158, 29);
panel.add(lbSearch);
btnSave = new JButton("");
btnSave.setOpaque(false);
btnSave.setContentAreaFilled(false);
btnSave.setBorderPainted(false);
btnSave.setIcon(new
ImageIcon(this.getClass().getResource("/btnsave2.png")));
btnSave.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
String sql="";
LbMessage.setText("សូមច្ប្ជើសច្រើសប្រច្្ទឆំណ្ថ្ ..!");
if(rdRiels.isSelected()){
if(txtRDG.getText().equals("")){
LbMessage.setText("សូមរញ្ជូ លទឹកប្ាក់ច្ៅកន្ប្រអរ់..!");
txtRDG.requestFocus();
}else{
double
amount=Double.parseDouble(txtRDG.getText());
sql="Update tbGuest Set Riels="+amount+"
Where Code="+ getID;
}
}
else if(rdDollar.isSelected()){
if(txtRDG.getText().equals("")){
LbMessage.setText("សូមរញ្ជូ លទឹកប្ាក់ច្ៅកន្ប្រអរ់..!");
txtRDG.requestFocus();
}else{
double
amount=Double.parseDouble(txtRDG.getText());
sql="Update tbGuest Set Dollars="+amount+"
Where Code="+ getID;
}
}
else if(rdGift.isSelected()){
if(txtRDG.getText().equals("")){
LbMessage.setText("សូមរញ្ជូ លការ ូច្ៅកន្ប្រអរ់..!");
txtRDG.requestFocus();
}else{
String gift="'"+txtRDG.getText()+"'";
sql="Update tbGuest Set Gift=N"+gift+" Where
Code="+ getID;
}
}
int r=0;
try {
r = stmt.executeUpdate(sql);
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
if(r==1){
LbMessage.setText("អរ់អរសារទ
!ច្ កអនកានរញ្ជូ លទិននន័យានច្ោគជ័យ..!");
int rc= model.getRowCount();
for(int i = 0;i<rc;i++){
model.removeRow(0);
}
windowOpened(null);
}
}@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
btnSave.setIcon(new
ImageIcon(this.getClass().getResource("/btnSave2.png")));
}@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
btnSave.setIcon(new
ImageIcon(this.getClass().getResource("/btnSave3.png")));
}
});
btnSave.setBounds(48, 550, 87, 35);
contentPane.add(btnSave);
btnNew = new JButton("");
btnNew.setOpaque(false);
btnNew.setContentAreaFilled(false);
btnNew.setBorderPainted(false);
btnNew.setIcon(new
ImageIcon(this.getClass().getResource("/btnNew.png")));
btnNew.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
clearData();
LbMessage.setText("");
txtName.requestFocus();
enabledButton(true);
hideComponent();
bg.clearSelection();
}@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
btnNew.setIcon(new
ImageIcon(this.getClass().getResource("/btnNew.png")));
}@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
btnNew.setIcon(new
ImageIcon(this.getClass().getResource("/btnNew1.png")));
}
});
btnNew.setBounds(171, 550, 87, 35);
contentPane.add(btnNew);
btnClose = new JButton();
btnClose.setOpaque(false);
btnClose.setContentAreaFilled(false);
btnClose.setBorderPainted(false);
btnClose.setIcon(new
ImageIcon(this.getClass().getResource("/btnExit2.png")));
btnClose.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
int i=0;
i=JOptionPane.showConfirmDialog(null, "Do you want to
close?");
if(i==0){
dispose();
}
}@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
btnClose.setIcon(new
ImageIcon(this.getClass().getResource("/btnExit2.png")));
}@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
btnClose.setIcon(new
ImageIcon(this.getClass().getResource("/btnExit3.png")));
}
});
btnClose.setBounds(296, 550, 94, 35);
contentPane.add(btnClose);
lbGroom = new JLabel("");
lbGroom.setHorizontalAlignment(SwingConstants.CENTER);
lbGroom.setForeground(Color.ORANGE);
lbGroom.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
18));
lbGroom.setBounds(397, 135, 126, 29);
contentPane.add(lbGroom);
lbBride = new JLabel("");
lbBride.setHorizontalAlignment(SwingConstants.CENTER);
lbBride.setForeground(Color.ORANGE);
lbBride.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
18));
lbBride.setBounds(650, 135, 126, 29);
contentPane.add(lbBride);
rdDollar = new JRadioButton("ប្ាក់ ា រ");
rdDollar.setBackground(new Color(112, 128, 144));
rdDollar.setForeground(new Color(248, 248, 255));
rdDollar.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
lbShift.setVisible(true);
txtRDG.setVisible(true);
lbShift.setText("ឆំនួនទឹកប្ាក់");
LbMessage.setText("");
txtRDG.requestFocus();
}
});
rdDollar.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
14));
rdDollar.setBounds(159, 394, 120, 51);
contentPane.add(rdDollar);
rdGift = new JRadioButton("កា ូរ");
rdGift.setBackground(new Color(112, 128, 144));
rdGift.setForeground(new Color(248, 248, 255));
rdGift.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
lbShift.setVisible(true);
lbShift.setText("កា ូរ");
txtRDG.setVisible(true);
txtRDG.requestFocus();
LbMessage.setText("");
}
});
rdGift.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
14));
rdGift.setBounds(289, 394, 79, 51);
contentPane.add(rdGift);
bg=new ButtonGroup();
bg.add(rdDollar);
bg.add(rdGift);
lbShift = new JLabel("New label");
lbShift.setForeground(new Color(153, 50, 204));
lbShift.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
14));
lbShift.setBounds(36, 456, 126, 29);
contentPane.add(lbShift);
txtRDG = new JTextField();
txtRDG.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent arg0) {
if(txtRDG.getText()!=""){
LbMessage.setText("");
}
}
});
txtRDG.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
14));
txtRDG.setColumns(10);
txtRDG.setBounds(170, 454, 228, 32);
contentPane.add(txtRDG);
JPanel panel_1 = new JPanel();
panel_1.setBackground(new Color(112, 128, 144));
panel_1.setBounds(36, 394, 354, 51);
contentPane.add(panel_1);
panel_1.setLayout(null);
rdRiels = new JRadioButton("ប្ាក់ច្រៀល");
rdRiels.setBounds(6, 0, 94, 49);
panel_1.add(rdRiels);
rdRiels.setBackground(new Color(112, 128, 144));
rdRiels.setForeground(new Color(248, 248, 255));
rdRiels.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
lbShift.setVisible(true);
lbShift.setText("ឆំនួនទឹកប្ាក់");
txtRDG.setVisible(true);
txtRDG.requestFocus();
LbMessage.setText("");
}
});
rdRiels.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
14));
bg.add(rdRiels);
LbMessage = new JLabel("");
LbMessage.setHorizontalAlignment(SwingConstants.CENTER);
LbMessage.setForeground(Color.RED);
LbMessage.setFont(new Font("Khmer OS Bokor", Font.PLAIN, 14));
LbMessage.setBounds(36, 497, 362, 29);
contentPane.add(LbMessage);
txtName = new JLabel("");
txtName.setOpaque(true);
txtName.setBackground(new Color(192, 192, 192));
txtName.setForeground(new Color(0, 0, 128));
txtName.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
14));
txtName.setBounds(149, 243, 234, 29);
contentPane.add(txtName);
cboTitle = new JLabel("");
cboTitle.setOpaque(true);
cboTitle.setBackground(new Color(192, 192, 192));
cboTitle.setForeground(new Color(0, 0, 128));
cboTitle.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
14));
cboTitle.setBounds(149, 283, 234, 29);
contentPane.add(cboTitle);
txtAddress = new JLabel("");
txtAddress.setOpaque(true);
txtAddress.setVerticalAlignment(SwingConstants.TOP);
txtAddress.setBackground(new Color(192, 192, 192));
txtAddress.setForeground(new Color(0, 0, 128));
txtAddress.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
14));
txtAddress.setBounds(149, 326, 234, 56);
contentPane.add(txtAddress);
lbPicture = new JLabel("");
lbPicture.setBounds(0, 0, 1179, 619);
contentPane.add(lbPicture);
lbPicture.setIcon(new
ImageIcon(this.getClass().getResource("/BGuest.png")));
lbShift.setVisible(false);
txtRDG.setVisible(false);
enabledButton(false);
setVisible(true);
}
 Form របាយការែ៏
public frmReport() {
setResizable(false);
setUndecorated(true);//Remove Title bar
setLocationRelativeTo(null);
Operators ops=new Operators();
//----- Set Form Center Screen--------
int width=996,height=513;
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
int x = (screen.width - width) / 2;
int y = (screen.height - height) / 2;
setBounds(x, y, width, height);
//------------------------------------
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JButton btnNewButton = new JButton("");
btnNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
dispose();
}
});
btnNewButton.setFont(new Font("Tahoma", Font.PLAIN, 10));
btnNewButton.setBounds(963, 0, 34, 30);
btnNewButton.setIcon(new
ImageIcon(this.getClass().getResource("/close.png")));
btnNewButton.setBackground(null);
btnNewButton.setOpaque(false);
btnNewButton.setContentAreaFilled(false);
btnNewButton.setBorderPainted(false);
contentPane.add(btnNewButton);
lbGName = new JLabel("Groom Name");
lbGName.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
20));
lbGName.setHorizontalAlignment(SwingConstants.CENTER);
lbGName.setBounds(274, 168, 145, 38);
contentPane.add(lbGName);
LbBName = new JLabel("Bride Name");
LbBName.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
20));
LbBName.setHorizontalAlignment(SwingConstants.CENTER);
LbBName.setBounds(536, 168, 180, 38);
contentPane.add(LbBName);
JLabel label = new JLabel("រាយការណ៏ សររថ្នពិធីម្គលការ");
label.setForeground(new Color(220, 20, 60));
label.setFont(new Font("Khmer OS Bokor", Font.PLAIN, 20));
label.setBounds(329, 238, 243, 38);
contentPane.add(label);
JPanel panel = new JPanel();
panel.setBackground(new Color(222, 184, 135));
panel.setBounds(95, 276, 801, 181);
contentPane.add(panel);
panel.setLayout(null);
LbTGC = new JLabel();
LbTGC.setForeground(Color.BLUE);
LbTGC.setBounds(10, 67, 421, 46);
LbTGC.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 20));
panel.add(LbTGC);
LbTAG = new JLabel();
LbTAG.setForeground(Color.BLUE);
LbTAG.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 20));
LbTAG.setBounds(10, 124, 421, 46);
panel.add(LbTAG);
LbTR = new JLabel();
LbTR.setForeground(Color.BLUE);
LbTR.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 20));
LbTR.setBounds(441, 11, 350, 46);
panel.add(LbTR);
LbTD = new JLabel();
LbTD.setForeground(Color.BLUE);
LbTD.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 20));
LbTD.setBounds(441, 67, 350, 46);
panel.add(LbTD);
LbTGift = new JLabel();
LbTGift.setForeground(Color.BLUE);
LbTGift.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
20));
LbTGift.setBounds(441, 124, 350, 46);
panel.add(LbTGift);
LbTG = new JLabel();
LbTG.setForeground(Color.BLUE);
LbTG.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 20));
LbTG.setBounds(10, 10, 421, 46);
panel.add(LbTG);
JLabel lblNewLabel = new JLabel("");
lblNewLabel.setBounds(0, 0, 997, 518);
lblNewLabel.setIcon(new
ImageIcon(this.getClass().getResource("/report2.png")));
contentPane.add(lblNewLabel);
///------- Opened Form-----
String sql;
ops.SetConnectionSql();
//--------Groom Name and Bride Name----------
sql="select GroomName,BrideName from tbUser";
try {
ops.rs=ops.stmt.executeQuery(sql);
while(ops.rs.next()){
lbGName.setText(ops.rs.getString(1));
LbBName.setText(ops.rs.getString(2));
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
//--------count Money--------------------
sql ="select format(sum(Riels),'0')as
R,format(sum(Dollars),'0.00')as D from dbWedding.dbo.tbGuest";
try {
ops.rs=ops.stmt.executeQuery(sql);
while(ops.rs.next()){
LbTR.setText("ទឹកប្ាក់សររោច្រៀល៖ "+
ops.rs.getString(1)+" ច្រៀល");
LbTD.setText("ទឹកប្ាក់សររោ ា ៖
"+ops.rs.getString(2)+" ា ");
}
//--------count Gift---------------------
sql="select COUNT(Gift)as G from dbWedding.dbo.tbGuest
where Gift is not null ";
ops.rs=ops.stmt.executeQuery(sql);
while(ops.rs.next()){
LbTGift.setText("ឆំនួនការ ូរសររ៖ "+
ops.rs.getString(1));
}
//------Count Guest not join-------------
sql="select count(*) from dbWedding.dbo.tbGuest where
Riels is null and Dollars is null and Gift is null";
ops.rs=ops.stmt.executeQuery(sql);
while(ops.rs.next()){
LbTAG.setText("ឆំនូនច្្ញៀវមិនានឆូលរួមសររ៖
"+ops.rs.getString(1) +" នាក់");
}
//-------Count Guest join---------------
sql="select count(*) from dbWedding.dbo.tbGuest where
Riels is not null or Dollars is not null or Gift is not null";
ops.rs=ops.stmt.executeQuery(sql);
while(ops.rs.next()){
LbTGC.setText("ឆំនូនច្្ញៀវឆូលរួមសររ៖ "+
ops.rs.getString(1)+" នាក់");
}
//-------count all guest-----------------
sql="select count(*) from dbWedding.dbo.tbGuest ";
ops.rs=ops.stmt.executeQuery(sql);
while(ops.rs.next()){
LbTG.setText("ឆំនូនច្្ញៀវស្ លានច្ៅសររ៖
"+ops.rs.getString(1)+" នាក់");
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
 Form អំពីពួកលយើង
public frmAbout() {
setResizable(false);
setUndecorated(true);//Remove Title bar
setLocationRelativeTo(null);
Operators ops=new Operators();
//----- Set Form Center Screen--------
int width=996,height=513;
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
int x = (screen.width - width) / 2;
int y = (screen.height - height) / 2;
setBounds(x, y, width, height);
//------------------------------------
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JButton btnNewButton = new JButton("");
btnNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
dispose();
}
});
btnNewButton.setFont(new Font("Tahoma", Font.PLAIN, 10));
btnNewButton.setBounds(963, 0, 34, 30);
btnNewButton.setIcon(new
ImageIcon(this.getClass().getResource("/close.png")));
btnNewButton.setBackground(null);
btnNewButton.setOpaque(false);
btnNewButton.setContentAreaFilled(false);
btnNewButton.setBorderPainted(false);
contentPane.add(btnNewButton);
JLabel lblNewLabel_1 = new JLabel("");
lblNewLabel_1.setBounds(40, 40, 115, 115);
lblNewLabel_1.setIcon(new
ImageIcon(this.getClass().getResource("/logo.png")));
contentPane.add(lblNewLabel_1);
JPanel panel = new JPanel();
panel.setBackground(new Color(211, 211, 211));
panel.setBounds(367, 98, 564, 369);
contentPane.add(panel);
panel.setLayout(null);
String text =
"<html><p>&nbsp;&nbsp;ច្ោយានច្រៀររារ់ច្ៅកន្ឆំនឆខា្ច្លើច្នោះខាោះរួឆមកច្ហើយច្យើ្ច្ ើញថាវា
មានការលំាក<br />"
+
"ឆំច្ពាោះមាច ស់កមមវិធី ូច្ឆនោះច្ោលរំណ្ថ្នកមមវិធីច្នោះគឺជួយកាត់រនថយនូវរញ្ជា ទាំ្អស់ច្នោះាន។<br />"
+
"កមមវិធីច្នោះអាឆច្ធែើការរូកសររនូវឆំនួនទឹកប្ាក់ឆំណ្ថ្ ររស់ច្្ញៀវអាឆច្ធែើការកត់ប្ានូវច្្ម ោះច្្ញៀវ<br
/>"
+
"ទាំ្អស់ស្ លប្តូវអច្ញ្ជ ើញងាយស្សួលស្សែ្រកច្្ម ោះច្្ញៀវោមួយនឹ្ទឹកប្ាក់ឆំណ្ថ្ ររស់ោត់<br />"
+
"ឬអាឆោអំច្ោយវតថអនសាវរីយ៏ោច្ ើម។កមមវិធីច្នោះអាឆរកាទកនូវ រាល់ទិននន័យ ទាំ្អស់មិន<br
/>"
+
"ឲ្យាត់រ្់ឬខូឆខាតច្ ើយ។កមមវិធីច្នោះក៏អាឆសររច្ធែើោរាយការណ៏ នូវទឹកប្ាក់ានផ្ស្ រ។</p></ht
ml>";
JLabel label = new JLabel(text);
label.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 15));
label.setBounds(10, 176, 554, 182);
panel.add(label);
JLabel label_3 = new JLabel("ច្ោលរំណ្ថ្នកមមវិធី");
label_3.setForeground(new Color(255, 0, 0));
label_3.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
14));
label_3.setBounds(10, 146, 161, 36);
panel.add(label_3);
JLabel label_4 = new JLabel("សមាជិកប្កុម");
label_4.setForeground(new Color(255, 0, 0));
label_4.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
14));
label_4.setBounds(10, 58, 100, 36);
panel.add(label_4);
JLabel label_5 = new JLabel("សាស្ដ្សាដ ចារយ");
label_5.setForeground(new Color(255, 0, 0));
label_5.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
14));
label_5.setBounds(10, 11, 100, 36);
panel.add(label_5);
JLabel label_6 = new JLabel("ជី គួ្");
label_6.setForeground(new Color(0, 0, 128));
label_6.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
14));
label_6.setBounds(114, 11, 57, 36);
panel.add(label_6);
JLabel label_7 = new JLabel("សឹ្ សារា៉ាវីត");
label_7.setForeground(new Color(0, 0, 128));
label_7.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
14));
label_7.setBounds(114, 75, 99, 36);
panel.add(label_7);
JLabel label_8 = new JLabel("មា៉ា ន់ មករា");
label_8.setForeground(new Color(0, 0, 128));
label_8.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
14));
label_8.setBounds(114, 112, 93, 36);
panel.add(label_8);
JLabel label_9 = new JLabel(" ីម សខ ី");
label_9.setForeground(new Color(0, 0, 128));
label_9.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
14));
label_9.setBounds(270, 75, 93, 36);
panel.add(label_9);
JLabel label_10 = new JLabel("ស្ទម ឌីោ");
label_10.setForeground(new Color(0, 0, 128));
label_10.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
14));
label_10.setBounds(270, 112, 93, 36);
panel.add(label_10);
JLabel lblNewLabel_2 = new JLabel("អំពីពួកច្យើ្");
lblNewLabel_2.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel_2.setForeground(new Color(255, 127, 80));
lblNewLabel_2.setFont(new Font("Khmer OS Muol Light",
Font.PLAIN, 23));
lblNewLabel_2.setBounds(538, 53, 179, 43);
contentPane.add(lblNewLabel_2);
JLabel lblVersion = new JLabel("Version: 1.0");
lblVersion.setForeground(new Color(255, 127, 80));
lblVersion.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
16));
lblVersion.setBounds(141, 400, 101, 30);
contentPane.add(lblVersion);
JLabel label_1 = new JLabel("ឆ្ន ំ២០១៥-២០១៦");
label_1.setForeground(new Color(255, 127, 80));
label_1.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
16));
label_1.setBounds(121, 341, 153, 30);
contentPane.add(label_1);
JLabel label_2 = new JLabel("កមមវិធីកត់ប្ាឆំណ្ថ្ អាពាហ៏ពិពាហ៏");
label_2.setForeground(new Color(255, 127, 80));
label_2.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
16));
label_2.setBounds(40, 271, 315, 30);
contentPane.add(label_2);
JLabel label_11 = new JLabel("");
label_11.setBounds(40, 123, 317, 379);
label_11.setIcon(new
ImageIcon(this.getClass().getResource("/slide.png")));
contentPane.add(label_11);
JLabel lblNewLabel = new JLabel("");
lblNewLabel.setBounds(0, 0, 997, 518);
lblNewLabel.setIcon(new
ImageIcon(this.getClass().getResource("/aboutus.png")));
contentPane.add(lblNewLabel);
}
 Form ជំនួយ
public frmHelp() {
setResizable(false);
setUndecorated(true);//Remove Title bar
setLocationRelativeTo(null);
Operators ops=new Operators();
//----- Set Form Center Screen--------
int width=996,height=513;
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
int x = (screen.width - width) / 2;
int y = (screen.height - height) / 2;
setBounds(x, y, width, height);
//------------------------------------
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JButton btnNewButton = new JButton("");
btnNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
dispose();
}
});
btnNewButton.setFont(new Font("Tahoma", Font.PLAIN, 10));
btnNewButton.setBounds(963, 0, 34, 30);
btnNewButton.setIcon(new
ImageIcon(this.getClass().getResource("/close.png")));
btnNewButton.setBackground(null);
btnNewButton.setOpaque(false);
btnNewButton.setContentAreaFilled(false);
btnNewButton.setBorderPainted(false);
contentPane.add(btnNewButton);
String text = "<html><p>1. ច្ ើមបីច្ប្រើប្ាស់កមមវិធីច្នោះាន
អនកច្ប្រើប្ាស់ប្តូវមានគណនីមួយសំរារ់ច្រើកកមមវិធី<br />"
+ "2. រច្រៀររច្្កើតគណនី៖ ឆឆច្លើរូត្ (រច្្កើតទិននន័យ)=>
រំច្ពញព័ត៌មានកូនកំច្ ោះ និ្កូនប្កមំ <br />&#09;,ថ្ថ្ៃច្រៀរអាពាហ៏ពិពាហ៏ ច្ហើយនឹ្
ពាកយសំងាត់ច្ ើមបីឆូលច្ប្រើប្ាស់ាន។ <br />"
+ "3. ឆំច្ពាោះការឆូលច្ប្រើប្ាស់៖
វាយពាកយសំងាត់ស្ លច្យើ្ានរច្្កើតច្ៅច្ពល រច្្កើតទិននន័យ ។ <br />&#09;ច្រើសិន
វាយពាកយសំងាត់ខសឆំនួន ៥ ្ ច្នាោះកមមវិធីប្តូវានរិទ ច្ោយសែ័យ<br />&#09;ប្រវតដ។<br />"
+ "4. ឆំច្ពាោះគណនី៖ ឆំច្ពាោះគណនីស្ លានរច្្កើតរួឆច្ហើយ
ច្យើ្អាឆផ្លា ស់រដូរព័ត៌មានច្ពលច្ប្កាយ <br />&#09;ាន។<br />"
+ "5. ការកត់ប្ាព័ត៌មានច្្ញៀវ៖ <br />&#09;-
កត់ច្្ម ោះច្្ញៀវច្ ើមបីអច្ញ្ជ ើញឆូលរួមកន្កមមវីធីម្គលការ<br />&#09;-
កត់ប្ាឆំណ្ថ្ ច្ពលច្្ញៀវឆូលរួមកន្កមមវិធីម្គលការ<br />"
+ "6. រូកសរររាយការណ៏ ថ្នការឆូលរួមររស់ច្្ញៀវ នឹ្
រូកសររឆំណ្ថ្ ច្ហើយនឹ្កា ូរ។</p></html>";
JLabel label = new JLabel(text);
label.setVerticalAlignment(SwingConstants.TOP);
label.setBounds(0,11,559,398);
contentPane.add(label);
label.setFont(new Font("Khmer OS Battambang", Font.PLAIN,
15));
JScrollPane scroller = new JScrollPane(label,
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
scroller.setBounds(401,82,559,398);
contentPane.add(scroller);
JLabel label_3 = new JLabel("ជំនួយថ្នការច្ប្រើប្ាស់កមមវិធី");
label_3.setBounds(401, 44, 208, 38);
contentPane.add(label_3);
label_3.setForeground(new Color(255, 0, 0));
label_3.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
14));
JLabel label_1 = new JLabel("");
label_1.setBounds(120, 44, 115, 115);
label_1.setIcon(new
ImageIcon(this.getClass().getResource("/logo.png")));
contentPane.add(label_1);
JLabel label_2 = new JLabel("");
label_2.setIcon(new
ImageIcon(this.getClass().getResource("/slide.png")));
label_2.setBounds(40, 117, 320, 363);
contentPane.add(label_2);
JLabel label_4 = new JLabel("កមមវិធីកត់ប្ាឆំណ្ថ្ អាពាហ៏ពិពាហ៏");
label_4.setForeground(new Color(255, 127, 80));
label_4.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
16));
label_4.setBounds(62, 280, 315, 48);
contentPane.add(label_4);
JLabel label_5 = new JLabel("ឆ្ន ំ២០១៥-២០១៦");
label_5.setForeground(new Color(255, 127, 80));
label_5.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
16));
label_5.setBounds(143, 358, 153, 38);
contentPane.add(label_5);
JLabel label_6 = new JLabel("Version: 1.0");
label_6.setForeground(new Color(255, 127, 80));
label_6.setFont(new Font("Khmer OS Muol Light", Font.PLAIN,
16));
label_6.setBounds(163, 415, 101, 38);
contentPane.add(label_6);
JLabel lblNewLabel = new JLabel("");
lblNewLabel.setBounds(0, 0, 997, 518);
lblNewLabel.setIcon(new
ImageIcon(this.getClass().getResource("/aboutus.png")));
contentPane.add(lblNewLabel);
}
ជំពូកទី ៣ សេចកតីេៃនិដ្ឋា ៃេសស្រម្ច ៃិង ម្តិសោបល់
លោយមានការខិតខំ្បឹងផ្្បងលធវើការ្សាវ្ជាវាមរយៈ្បព័នធ Internet រួមទំងមានការបងាា ត់បល្ងៀន
លោយយកចិតតទ្យុកោក់ខពេ់ពីលោកសាស្ត្សាត ចារយ ជី គួង នង រួមនេំនឹងការពិភាកាជាមួយេមាជិកលៅកែុង្កុមនង
លនេះ លទ្យើបពួកលយើងបានបលងកើតនូវកមមវិធីលនេះល ើងបានលោយលជាគជ័យ។ កមមវិធីលនេះបលងកើតល ើងាមភាសា Java
Programming ជាមួយ Interface Swing រួមនេំនឹងរូបភាពលែើមបីទក់ទញនូវចំណាប់អារមមែ៏ របេ់អែកល្បើ្បាេ់។
កមមវិធីលនេះមាននល្បលយជន៏ជាល្ចើនផ្ែលជួយេ្មួលែល់មាេ េ់កមមវិធីលៅកែុងការកត់ល្ម េះលភ្ៀវ
កត់ចំែងថ្ែលភ្ៀវ លធវើរបាយការែ៏ េរុបអំពីលភ្ៀវ ចំនួនទ្យឹក្បាក់ចំែងថ្ែ ចំនួនវតថុអនុេាវរីយ៍ ឬ អំលណាយលនេងៗ
នងផ្ែរ។ លទេះបីជាយ៉ា ងណាក៏លោយក៏កមមវិធីលនេះលៅផ្តមានគុែវិបតតិនងផ្ែរចំលពាេះអែកល្បើ្បាេ់។
ងវីលបើកមមវិធីលនេះបលងកើតបានលជាគជ័យក៏ពិតផ្មន ផ្តវាក៏លៅមានភាពខវេះចលនល េះណាមួយ ឬ
កំ ុេឆ្ាងណាមួយលោយអលចតនជាក់ជាពុំខាន លោយសារផ្ត្កុមលយើងខ្ុំមិនទន់មានបទ្យពិលសាធន៍ល្ចើន
រីឯចំលែេះែឹងក៏លៅមានក្មិត ែូលចែេះលយើងខ្ុំេូមលមាត អភ័យលទេទ្យុកជាមុនទំងលៅលលើែំលែើ រការណាមួយលៅកែុង
កមមវិធី ក៏ែូចជាការលរៀបលរៀងជាលេៀវលៅលនេះល ើងនងផ្ែរ។
MSM_Management System Wedding Java
MSM_Management System Wedding Java

More Related Content

Viewers also liked

Calc224FinalExamReview
Calc224FinalExamReviewCalc224FinalExamReview
Calc224FinalExamReviewTori Peña
 
The Mobile Language Learning Field
The Mobile Language Learning FieldThe Mobile Language Learning Field
The Mobile Language Learning FieldSteve McCarty
 
Ensayo sobre el libro y recomendación
Ensayo sobre el libro y recomendaciónEnsayo sobre el libro y recomendación
Ensayo sobre el libro y recomendaciónJairo Gomez
 
The Cellphone Culture and Public Health
The Cellphone Culture and Public HealthThe Cellphone Culture and Public Health
The Cellphone Culture and Public Healthcraig lefebvre
 
Blogs in the Classroom
Blogs in the ClassroomBlogs in the Classroom
Blogs in the ClassroomAlisa Cooper
 
MetaVis Webinar - Disruptive Governance Thinking For The Masses
MetaVis Webinar - Disruptive Governance Thinking For The MassesMetaVis Webinar - Disruptive Governance Thinking For The Masses
MetaVis Webinar - Disruptive Governance Thinking For The MassesAntony Clay
 
Linux is Academic
Linux is AcademicLinux is Academic
Linux is Academicbradspry
 

Viewers also liked (10)

Historia del derecho
Historia del derechoHistoria del derecho
Historia del derecho
 
Calc224FinalExamReview
Calc224FinalExamReviewCalc224FinalExamReview
Calc224FinalExamReview
 
The Mobile Language Learning Field
The Mobile Language Learning FieldThe Mobile Language Learning Field
The Mobile Language Learning Field
 
Ensayo sobre el libro y recomendación
Ensayo sobre el libro y recomendaciónEnsayo sobre el libro y recomendación
Ensayo sobre el libro y recomendación
 
The Cellphone Culture and Public Health
The Cellphone Culture and Public HealthThe Cellphone Culture and Public Health
The Cellphone Culture and Public Health
 
Blogs in the Classroom
Blogs in the ClassroomBlogs in the Classroom
Blogs in the Classroom
 
Ecosistemas
EcosistemasEcosistemas
Ecosistemas
 
Spraakets
SpraaketsSpraakets
Spraakets
 
MetaVis Webinar - Disruptive Governance Thinking For The Masses
MetaVis Webinar - Disruptive Governance Thinking For The MassesMetaVis Webinar - Disruptive Governance Thinking For The Masses
MetaVis Webinar - Disruptive Governance Thinking For The Masses
 
Linux is Academic
Linux is AcademicLinux is Academic
Linux is Academic
 

Similar to MSM_Management System Wedding Java

Rancangan tahunan-ictl-form-2-2013
Rancangan tahunan-ictl-form-2-2013Rancangan tahunan-ictl-form-2-2013
Rancangan tahunan-ictl-form-2-2013Shaharizan Hassan
 
Minor Project Synopsis on Data Structure Visualizer
Minor Project Synopsis on Data Structure VisualizerMinor Project Synopsis on Data Structure Visualizer
Minor Project Synopsis on Data Structure VisualizerRonitShrivastava057
 
English_Resume_KexiongSong
English_Resume_KexiongSongEnglish_Resume_KexiongSong
English_Resume_KexiongSongKexiong Song
 
Part 1 implementing a simple_web_service
Part 1 implementing a simple_web_servicePart 1 implementing a simple_web_service
Part 1 implementing a simple_web_servicekrishmdkk
 
JiyongKim_HHMI report
JiyongKim_HHMI reportJiyongKim_HHMI report
JiyongKim_HHMI reportJiyong Kim
 
Bài 12: JSF-2 - Lập Trình Mạng Nâng Cao
Bài 12:  JSF-2 - Lập Trình Mạng Nâng CaoBài 12:  JSF-2 - Lập Trình Mạng Nâng Cao
Bài 12: JSF-2 - Lập Trình Mạng Nâng CaoTuan Nguyen
 
Term 3 class8_2019-2020
Term 3 class8_2019-2020Term 3 class8_2019-2020
Term 3 class8_2019-2020Andrew Raj
 
ASP.NET MVC 5 Building Your First Web Application (A Beginner S Guide
ASP.NET MVC 5  Building Your First Web Application (A Beginner S GuideASP.NET MVC 5  Building Your First Web Application (A Beginner S Guide
ASP.NET MVC 5 Building Your First Web Application (A Beginner S GuideAlicia Buske
 
Programming Without Coding Technology (PWCT) Features - Programming Paradigm
Programming Without Coding Technology (PWCT) Features - Programming ParadigmProgramming Without Coding Technology (PWCT) Features - Programming Paradigm
Programming Without Coding Technology (PWCT) Features - Programming ParadigmMahmoud Samir Fayed
 
Mis 589 Success Begins / snaptutorial.com
Mis 589  Success Begins / snaptutorial.comMis 589  Success Begins / snaptutorial.com
Mis 589 Success Begins / snaptutorial.comWilliamsTaylor44
 
Mis 589 Massive Success / snaptutorial.com
Mis 589 Massive Success / snaptutorial.comMis 589 Massive Success / snaptutorial.com
Mis 589 Massive Success / snaptutorial.comStephenson185
 
30500932 ictl-form-two-yearly-plan-rancangan-tahunan-ictl-ting-2
30500932 ictl-form-two-yearly-plan-rancangan-tahunan-ictl-ting-230500932 ictl-form-two-yearly-plan-rancangan-tahunan-ictl-ting-2
30500932 ictl-form-two-yearly-plan-rancangan-tahunan-ictl-ting-2Farid Yusof
 
CASE STUDY InternetExcel Exercises, page 434, textRecord your.docx
CASE STUDY InternetExcel Exercises, page 434, textRecord your.docxCASE STUDY InternetExcel Exercises, page 434, textRecord your.docx
CASE STUDY InternetExcel Exercises, page 434, textRecord your.docxketurahhazelhurst
 
Presentation GuidelinesCYB 6010 Weeks-6 Presentation GuidelinesO.docx
Presentation GuidelinesCYB 6010 Weeks-6 Presentation GuidelinesO.docxPresentation GuidelinesCYB 6010 Weeks-6 Presentation GuidelinesO.docx
Presentation GuidelinesCYB 6010 Weeks-6 Presentation GuidelinesO.docxjeffsrosalyn
 

Similar to MSM_Management System Wedding Java (20)

Rancangan tahunan-ictl-form-2-2013
Rancangan tahunan-ictl-form-2-2013Rancangan tahunan-ictl-form-2-2013
Rancangan tahunan-ictl-form-2-2013
 
Minor Project Synopsis on Data Structure Visualizer
Minor Project Synopsis on Data Structure VisualizerMinor Project Synopsis on Data Structure Visualizer
Minor Project Synopsis on Data Structure Visualizer
 
English_Resume_KexiongSong
English_Resume_KexiongSongEnglish_Resume_KexiongSong
English_Resume_KexiongSong
 
Part 1 implementing a simple_web_service
Part 1 implementing a simple_web_servicePart 1 implementing a simple_web_service
Part 1 implementing a simple_web_service
 
JiyongKim_HHMI report
JiyongKim_HHMI reportJiyongKim_HHMI report
JiyongKim_HHMI report
 
SVD Based Blind Video Watermarking Algorithm
SVD Based Blind Video Watermarking AlgorithmSVD Based Blind Video Watermarking Algorithm
SVD Based Blind Video Watermarking Algorithm
 
Resume
ResumeResume
Resume
 
Bài 12: JSF-2 - Lập Trình Mạng Nâng Cao
Bài 12:  JSF-2 - Lập Trình Mạng Nâng CaoBài 12:  JSF-2 - Lập Trình Mạng Nâng Cao
Bài 12: JSF-2 - Lập Trình Mạng Nâng Cao
 
Online quiz system
Online quiz systemOnline quiz system
Online quiz system
 
Term 3 class8_2019-2020
Term 3 class8_2019-2020Term 3 class8_2019-2020
Term 3 class8_2019-2020
 
ASP.NET MVC 5 Building Your First Web Application (A Beginner S Guide
ASP.NET MVC 5  Building Your First Web Application (A Beginner S GuideASP.NET MVC 5  Building Your First Web Application (A Beginner S Guide
ASP.NET MVC 5 Building Your First Web Application (A Beginner S Guide
 
AIRPORT MANAGEMENT USING FACE RECOGNITION BASE SYSTEM
AIRPORT MANAGEMENT USING FACE RECOGNITION BASE SYSTEMAIRPORT MANAGEMENT USING FACE RECOGNITION BASE SYSTEM
AIRPORT MANAGEMENT USING FACE RECOGNITION BASE SYSTEM
 
Akash Damniya
Akash DamniyaAkash Damniya
Akash Damniya
 
Programming Without Coding Technology (PWCT) Features - Programming Paradigm
Programming Without Coding Technology (PWCT) Features - Programming ParadigmProgramming Without Coding Technology (PWCT) Features - Programming Paradigm
Programming Without Coding Technology (PWCT) Features - Programming Paradigm
 
Cspro training material
Cspro training materialCspro training material
Cspro training material
 
Mis 589 Success Begins / snaptutorial.com
Mis 589  Success Begins / snaptutorial.comMis 589  Success Begins / snaptutorial.com
Mis 589 Success Begins / snaptutorial.com
 
Mis 589 Massive Success / snaptutorial.com
Mis 589 Massive Success / snaptutorial.comMis 589 Massive Success / snaptutorial.com
Mis 589 Massive Success / snaptutorial.com
 
30500932 ictl-form-two-yearly-plan-rancangan-tahunan-ictl-ting-2
30500932 ictl-form-two-yearly-plan-rancangan-tahunan-ictl-ting-230500932 ictl-form-two-yearly-plan-rancangan-tahunan-ictl-ting-2
30500932 ictl-form-two-yearly-plan-rancangan-tahunan-ictl-ting-2
 
CASE STUDY InternetExcel Exercises, page 434, textRecord your.docx
CASE STUDY InternetExcel Exercises, page 434, textRecord your.docxCASE STUDY InternetExcel Exercises, page 434, textRecord your.docx
CASE STUDY InternetExcel Exercises, page 434, textRecord your.docx
 
Presentation GuidelinesCYB 6010 Weeks-6 Presentation GuidelinesO.docx
Presentation GuidelinesCYB 6010 Weeks-6 Presentation GuidelinesO.docxPresentation GuidelinesCYB 6010 Weeks-6 Presentation GuidelinesO.docx
Presentation GuidelinesCYB 6010 Weeks-6 Presentation GuidelinesO.docx
 

More from Sami Mut

C# Tutorial MSM_Murach chapter-16-slides
C# Tutorial MSM_Murach chapter-16-slidesC# Tutorial MSM_Murach chapter-16-slides
C# Tutorial MSM_Murach chapter-16-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-25-slides
C# Tutorial MSM_Murach chapter-25-slidesC# Tutorial MSM_Murach chapter-25-slides
C# Tutorial MSM_Murach chapter-25-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-24-slides
C# Tutorial MSM_Murach chapter-24-slidesC# Tutorial MSM_Murach chapter-24-slides
C# Tutorial MSM_Murach chapter-24-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-23-slides
C# Tutorial MSM_Murach chapter-23-slidesC# Tutorial MSM_Murach chapter-23-slides
C# Tutorial MSM_Murach chapter-23-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-22-slides
C# Tutorial MSM_Murach chapter-22-slidesC# Tutorial MSM_Murach chapter-22-slides
C# Tutorial MSM_Murach chapter-22-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-21-slides
C# Tutorial MSM_Murach chapter-21-slidesC# Tutorial MSM_Murach chapter-21-slides
C# Tutorial MSM_Murach chapter-21-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-20-slides
C# Tutorial MSM_Murach chapter-20-slidesC# Tutorial MSM_Murach chapter-20-slides
C# Tutorial MSM_Murach chapter-20-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-19-slides
C# Tutorial MSM_Murach chapter-19-slidesC# Tutorial MSM_Murach chapter-19-slides
C# Tutorial MSM_Murach chapter-19-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-17-slides
C# Tutorial MSM_Murach chapter-17-slidesC# Tutorial MSM_Murach chapter-17-slides
C# Tutorial MSM_Murach chapter-17-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-18-slides
C# Tutorial MSM_Murach chapter-18-slidesC# Tutorial MSM_Murach chapter-18-slides
C# Tutorial MSM_Murach chapter-18-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-14-slides
C# Tutorial MSM_Murach chapter-14-slidesC# Tutorial MSM_Murach chapter-14-slides
C# Tutorial MSM_Murach chapter-14-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-13-slides
C# Tutorial MSM_Murach chapter-13-slidesC# Tutorial MSM_Murach chapter-13-slides
C# Tutorial MSM_Murach chapter-13-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-11-slides
C# Tutorial MSM_Murach chapter-11-slidesC# Tutorial MSM_Murach chapter-11-slides
C# Tutorial MSM_Murach chapter-11-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-12-slides
C# Tutorial MSM_Murach chapter-12-slidesC# Tutorial MSM_Murach chapter-12-slides
C# Tutorial MSM_Murach chapter-12-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-04-slides
C# Tutorial MSM_Murach chapter-04-slidesC# Tutorial MSM_Murach chapter-04-slides
C# Tutorial MSM_Murach chapter-04-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-10-slides
C# Tutorial MSM_Murach chapter-10-slidesC# Tutorial MSM_Murach chapter-10-slides
C# Tutorial MSM_Murach chapter-10-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-09-slides
C# Tutorial MSM_Murach chapter-09-slidesC# Tutorial MSM_Murach chapter-09-slides
C# Tutorial MSM_Murach chapter-09-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-08-slides
C# Tutorial MSM_Murach chapter-08-slidesC# Tutorial MSM_Murach chapter-08-slides
C# Tutorial MSM_Murach chapter-08-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-07-slides
C# Tutorial MSM_Murach chapter-07-slidesC# Tutorial MSM_Murach chapter-07-slides
C# Tutorial MSM_Murach chapter-07-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-06-slides
C# Tutorial MSM_Murach chapter-06-slidesC# Tutorial MSM_Murach chapter-06-slides
C# Tutorial MSM_Murach chapter-06-slidesSami Mut
 

More from Sami Mut (20)

C# Tutorial MSM_Murach chapter-16-slides
C# Tutorial MSM_Murach chapter-16-slidesC# Tutorial MSM_Murach chapter-16-slides
C# Tutorial MSM_Murach chapter-16-slides
 
C# Tutorial MSM_Murach chapter-25-slides
C# Tutorial MSM_Murach chapter-25-slidesC# Tutorial MSM_Murach chapter-25-slides
C# Tutorial MSM_Murach chapter-25-slides
 
C# Tutorial MSM_Murach chapter-24-slides
C# Tutorial MSM_Murach chapter-24-slidesC# Tutorial MSM_Murach chapter-24-slides
C# Tutorial MSM_Murach chapter-24-slides
 
C# Tutorial MSM_Murach chapter-23-slides
C# Tutorial MSM_Murach chapter-23-slidesC# Tutorial MSM_Murach chapter-23-slides
C# Tutorial MSM_Murach chapter-23-slides
 
C# Tutorial MSM_Murach chapter-22-slides
C# Tutorial MSM_Murach chapter-22-slidesC# Tutorial MSM_Murach chapter-22-slides
C# Tutorial MSM_Murach chapter-22-slides
 
C# Tutorial MSM_Murach chapter-21-slides
C# Tutorial MSM_Murach chapter-21-slidesC# Tutorial MSM_Murach chapter-21-slides
C# Tutorial MSM_Murach chapter-21-slides
 
C# Tutorial MSM_Murach chapter-20-slides
C# Tutorial MSM_Murach chapter-20-slidesC# Tutorial MSM_Murach chapter-20-slides
C# Tutorial MSM_Murach chapter-20-slides
 
C# Tutorial MSM_Murach chapter-19-slides
C# Tutorial MSM_Murach chapter-19-slidesC# Tutorial MSM_Murach chapter-19-slides
C# Tutorial MSM_Murach chapter-19-slides
 
C# Tutorial MSM_Murach chapter-17-slides
C# Tutorial MSM_Murach chapter-17-slidesC# Tutorial MSM_Murach chapter-17-slides
C# Tutorial MSM_Murach chapter-17-slides
 
C# Tutorial MSM_Murach chapter-18-slides
C# Tutorial MSM_Murach chapter-18-slidesC# Tutorial MSM_Murach chapter-18-slides
C# Tutorial MSM_Murach chapter-18-slides
 
C# Tutorial MSM_Murach chapter-14-slides
C# Tutorial MSM_Murach chapter-14-slidesC# Tutorial MSM_Murach chapter-14-slides
C# Tutorial MSM_Murach chapter-14-slides
 
C# Tutorial MSM_Murach chapter-13-slides
C# Tutorial MSM_Murach chapter-13-slidesC# Tutorial MSM_Murach chapter-13-slides
C# Tutorial MSM_Murach chapter-13-slides
 
C# Tutorial MSM_Murach chapter-11-slides
C# Tutorial MSM_Murach chapter-11-slidesC# Tutorial MSM_Murach chapter-11-slides
C# Tutorial MSM_Murach chapter-11-slides
 
C# Tutorial MSM_Murach chapter-12-slides
C# Tutorial MSM_Murach chapter-12-slidesC# Tutorial MSM_Murach chapter-12-slides
C# Tutorial MSM_Murach chapter-12-slides
 
C# Tutorial MSM_Murach chapter-04-slides
C# Tutorial MSM_Murach chapter-04-slidesC# Tutorial MSM_Murach chapter-04-slides
C# Tutorial MSM_Murach chapter-04-slides
 
C# Tutorial MSM_Murach chapter-10-slides
C# Tutorial MSM_Murach chapter-10-slidesC# Tutorial MSM_Murach chapter-10-slides
C# Tutorial MSM_Murach chapter-10-slides
 
C# Tutorial MSM_Murach chapter-09-slides
C# Tutorial MSM_Murach chapter-09-slidesC# Tutorial MSM_Murach chapter-09-slides
C# Tutorial MSM_Murach chapter-09-slides
 
C# Tutorial MSM_Murach chapter-08-slides
C# Tutorial MSM_Murach chapter-08-slidesC# Tutorial MSM_Murach chapter-08-slides
C# Tutorial MSM_Murach chapter-08-slides
 
C# Tutorial MSM_Murach chapter-07-slides
C# Tutorial MSM_Murach chapter-07-slidesC# Tutorial MSM_Murach chapter-07-slides
C# Tutorial MSM_Murach chapter-07-slides
 
C# Tutorial MSM_Murach chapter-06-slides
C# Tutorial MSM_Murach chapter-06-slidesC# Tutorial MSM_Murach chapter-06-slides
C# Tutorial MSM_Murach chapter-06-slides
 

Recently uploaded

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

MSM_Management System Wedding Java

  • 1. Royal University of Phnom Penh Department of Computer Science Assignment: JAVA Programming Lecturer: Chi Kuong Topic: កម្មវិធីកត់ចំណងដៃ Class: E1 Year: 3 Group Member: Soeng Saravit Mann Makara Khim Sokhy Tem Dina Generation: 17 Academic Year: 2015-2016
  • 2. មាតិកា I. ជំពូកទី ១ សេចកតីស្តើម្ 1. បរ ិបទដៃការេិកាស្រាវស្រាវ 2. បញ្ហា សោទ 3. សោលបំណង 4. Scope and Limitations 5. Software / Hardware requirements II. ជំពូកទី ២ Analysis, Design and Implement III. ជំពូកទី ៣ សេចកតីេៃនិដ្ឋា ៃេសស្រម្ច ៃិង ម្តិសោបល់ IV. បញ្ជីស្ម ោះរូបភាព 1. Figure 1: Form Welcome 2. Figure 2: Form Create Data 3. Figure 3: Form Log in 4. Figure 4: Form Main 5. Figure 5: Form Update User 6. Figure 6: Form Guest 7. Figure 7: Form Update Guest Money 8. Figure 8: Form Report 9. Figure 9: Form About us 10. Figure 10: Form Help V. Appendix A : How to use the program VI. ឯការសោង
  • 3. ជំពូកទី ១ សេចកតីស្តើម្ 1. បរ ិបទដៃការេិកាស្រាវស្រាវ ពិភពលោកលយើងលនេះបាននឹងកំពុងអភិវឌ្ឍពីមួយថ្ងៃលៅមួយថ្ងៃជាពិលេេខាងផ្នែកវិេ័យបលចេកវិទ្យាមានការ រីកចល្មើនខាល ំងគួរឲ្យកត់េមាា ល់។យ៉ា ងណាមិញ លបើលយើង្កលលកមកលមើលលៅកែុង្បលទ្យេកមពុជាលយើងវិញបលចេកវិទ្យា ក៏មានការរីកចល្មើនខាល ំងណាេ់ផ្ែរ ល ើយជាពិលេេ លៅកែុងពិធីមងាលការេម័យបចេុបបនែលយើងលមើលល ើញថាបាន បញ្េូ លនូវបលចេកវិទ្យាជាល្ចើន ែូចជា ការងតរូប មានការបញ្េ ំងជា Video Pre wedding ជាលែើម។លោយលមើលល ើញែូចលនេះល ើយបានជា្កុមរបេ់លយើងខ្ុំបានលលើកយកនូវកមមវិធីមួយផ្ែលជំនួយលៅកែុងពិ ធីលរៀបអាពា ៍ពិពា ៍ គឺកមមវិធី កត់ចំណងដៃ លោយមានការផ្ែនំពីលោកសា្សាត ចារយ ជី គួង ផ្ែលលោក្គូបានខិតខំបល្ងៀនអេ់ពីេមតថភាព។កមមវិធីបានជួយេ្មួលការងារល្ចើនែល់អែកផ្ែលកត់ចំែងថ្ែ រួមទំងមាេ េ់កមមវិធីនងផ្ែរ។ 2. បញ្ហា សោទ លោយលមើលល ើញថាលៅកែុងពិធីលរៀបមងាលការនីមួយៗមាេ េ់កមមវិធីផ្តងផ្តរវល់មមាញឹកល្ចើនកែុងការចាត់ផ្ច ងលរៀបចំកមមវិធី ពួកគាត់ផ្តងផ្តមានភាពខវេះចលនល េះណាមួយជាងជាពុំខាន។ តួយ៉ា ងែូចជាការលធវើបញ្េីរាយនមល្ម េះ លភ្ៀវផ្ែលនឹង្តូវអលញ្ជើញ ជួនកាលមានការេទួនល្ម េះ ឬ ក៏មានការលភលចល្ម េះជាលែើម។ 3. សោលបំណងដៃកម្មវិធី លោយបានលរៀបរាប់លៅកែុងចំនុចខាងលលើលនេះខលេះរួចមកល ើយលយើងល ើញថាវាមានការលំបាកចំលពាេះមាេ េ់កមម វិធីែូលចែេះលគាលបំែងថ្នកមមវិធីលនេះគឺជួយកាត់បនថយនូវបញ្ា ទំងអេ់លនេះបាន។កមមវិធីលនេះអាចលធវើការបូកេរុបនូវចំ នួនទ្យឹក្បាក់ចំែងថ្ែរបេ់លភ្ៀវអាចលធវើការកត់្ានូវល្ម េះលភ្ៀវទំងអេ់ផ្ែល្តូវអលញ្ជើញងាយ្េួលផ្េវករល្ម េះ លភ្ៀវជាមួយនឹងទ្យឹក្បាក់ចំែងថ្ែរបេ់គាត់ឬអាចជាអំលណាយវតថុអនុេាវរីយ៏ជាលែើម។កមមវិធីលនេះអាចរកាទ្យុកនូវ រាល់ទ្យិនែន័យទំងអេ់មិនឲ្យបាត់បង់ឬខូចខាតល ើយ។កមមវិធីលនេះក៏អាចេរុបលធវើជារបាយការែ៏ នូវទ្យឹក្បាក់បាននង ផ្ែរ។ 4. Scope and Limitation កមមវិធីលនេះអនុញ្ា តឲ្យអែកល្បើ្បាេ់បលងកើតគែនីផ្ទទ ល់ខលួនមួយេ្មាប់ចូលលៅល្បើ្បាេ់មុខងារេំខាន់ៗ មួយចំនួន។ បនទ ប់ពីបលងកើតគែនីរួចល ើយ អែកល្បើ្បាេ់អាចបញ្េូ លនូវល្ម េះ កូនកំលោេះ កូន្កមុំ រូបភាពកូនកំលោេះ កូន្កមុំ ថ្ងៃផ្ខឆ្ែ ំលរៀបមងាលការ។ មា៉ាងលទ្យៀតអែកល្បើ្បាេ់អាចបញ្េូ លល្ម េះលភ្ៀវផ្ែលនឹង្តូវ អលញ្ជើញមកចូលរួមទំងអេ់ជាភាសាផ្ខមរ ឬ អង់លគលេ។ លលើេពីលនេះ អែកល្បើ្បាេ់អាចលធវើការបូកេរុបនូវចំែងថ្ែ ចំនួនវតថុអនុេាវរីយ៍លនេងៗ អាចលធវើការផ្េវងរកល្ម េះលភ្ៀវរួមទំងទ្យឹក្បាក់ចំែងថ្ែបាននងផ្ែរ។ ល្ៅពីលនេះអែក
  • 4. ល្បើ្បាេ់អាចលធវើជារបាយការែ៏ បានលទ្យៀតនង។ 5. តស្រម្ូវការខាងផ្្នក Software/Hardware ១. ផ្នែក Hardware - Processor: Intel Pentium 4, 1.6 GHz or Higher - Hard Disk: Minimum of 1GB - Memory: 128MB RAM or higher - Display: Video Adapter and monitor with XGA (1024x768) or higher ២. ផ្នែក Software - OS: Windows - កមមវិធី កត់ចំែងថ្ែ - Java Development Kit (JDK) to develop java programs. - Microsoft SQL Server 2008 or Higher
  • 5. ជំពូកទី ២ Analysis Design Implement 1. Analysis មុននឹង្កុមលយើងខ្ុំចាប់លនតើមបលងកើតកមមវិធីលនេះល ើង្កុមរបេ់លយើងខ្ុំបានេិកាផ្េវងយល់ពីែំលែើ រការជាក់ ផ្េតងកែុងការចុេះល្ម េះលភ្ៀវ ផ្កត្មូវល្ម េះលភ្ៀវ លុប និងផ្េវងរកល្ម េះ។បនទ ប់ពីបានេិការួចមកលយើងកំែត់បាន នូវលកខខែឌ មួយចំនួន៖  បលងកើត Table ចំនួនពីរេ្មាប់នទុកទ្យិនែន័យ លោយល្បើ្បាេ់លៅកែុង Microsoft SQL Server 2012  Table User: ល្បើេ្មាប់នទុកនូវល្ម េះកូនកំលោេះ កូន្កមុំ ថ្ងៃផ្ខឆ្ែ ំលរៀបពិធីមងាលការ លលខកូែេមាៃ ត់េ្មាប់ល្បើ្បាេ់កមមវិធី។អាចរកាទ្យុក លុប ផ្កផ្្បតថ្មលបាននងផ្ែរ។  Table Guest: ល្បើេ្មាប់នទុកនូវល្ម េះលភ្ៀវទំងអេ់ អាេ័យោា ន ងារ ចំែងថ្ែជា្បាក់លរៀល ្បាក់ែុោល រ និង អំលណាយលនេងៗ។អាចរកាទ្យុក លុប ផ្កផ្្បតថ្មលបាននងផ្ែរ។  មុននឹងអាចល្បើ្បាេ់កមមវិធីលនេះបានជាែំបូងលយើង្តូវបលងកើតគែនីមួយ  បនទ ប់ពីបានបលងកើតគែនីល ើយ អែកល្បើ្បាេ់អាចចូលលៅកាន់ Form េ្មាប់លធវើការងារជាល្ចើនបាន ែូចជាកត់ល្ម េះលភ្ៀវ កត់ចំែងថ្ែលភ្ៀវ លធវើរបាយការបូកេរុបទ្យឹក្បាក់ចំែងថ្ែ 2. Design លៅកែុងការ Design កមមវិធីលនេះឲ្យលមើលលៅមានភាព្េេ់សាា ត ្កុមលយើងខ្ុំបានល្បើ្បាេ់នូវ Swing េ្មាប់លធវើជា Interface ល្ពាេះវាមានមុខងារជាល្ចើន និងនតល់ភាពងាយ្េួលកែុងការ Design GUI លៅកែុង Eclipse IDE គួបនេំនឹង Graphic Design លោយល្បើ្បាេ់ Adobe Photoshop CS6 នងផ្ែរ។ លយើងបានបលងកើត Form មួយចំនួនាមត្មូវការល្បើ្បាេ់លៅកែុងកមមវិធីលនេះែូចខាងល្កាម៖  From ែំបូងលពលលបើកកមមវិធី លៅកែុង Form លនេះផ្ែរលយើងបានបលងកើតជាបូតុងមួយជារូបភាពេ្មាប់ចុចចូលលៅល្បើ្បាេ់នូវ Form ែថ្ទ្យលទ្យៀតបាន។ លយើងបានបលងកើតបូតុងមួយលទ្យៀតេ្មាប់បិទ្យ Form នងផ្ែរ។ ែូចបងាា ញលៅកែុងរូបភាពខាង ល្កាម។
  • 6. Figure 1: Form Welcome  From េ្មាប់បលងកើតទ្យិនែន័យងមី លៅកែុង Form លនេះផ្ែរលយើងបានបលងកើតជាបូតុងពីរ មួយេ្មាប់រកាទ្យុកទ្យិនែន័យងមី និង មួយលទ្យៀតេ្មាប់ចាកលចញពីកមមវិធី។ លៅលពលផ្ែលលយើងលបើកែំបូងលយើង្តូវបលងកើតទ្យិនែន័យជាមុនេិន។ Figure 2: Form បលងកើតទ្យិនែន័យ
  • 7.  From េ្មាប់ចូលល្បើ្បាេ់កមមវិធី លៅកែុង Form លនេះផ្ែរលយើងបានបលងកើតជាបូតុងពីរ មួយេ្មាប់បលងកើតទ្យិនែន័យងមី និង មួយលទ្យៀតេ្មាប់ចូលល្បើ្បាេ់កមមវិធីទំងមូល លោយបញ្េូ លនូវពាកយេំងាត់ផ្ែលបានបលងកើតរួច ។ Figure 3: Form Log In  From Main លៅកែុង Form លនេះផ្ែរលយើងបានបលងកើតជាបូតុងចំនួន្បាំមួយផ្ែលជារូបភាព រួមទំងអកេរលៅពីខាង ល្កាម េ្មាប់លធវើការងារលនេងៗែូចផ្ែលបានបងាា ញលៅកែុងរូបភាពខាងល្កាម ។ លយើងក៏បានបលងកើតបូតុងមួយ េ្មាប់បិទ្យកមមវិធីលៅខាងល្កាម។ Figure 4: Form Main
  • 8.  From េ្មាប់ផ្កផ្្បព័ត៌មានអែកល្បើ្បាេ់ លៅកែុង Form លនេះផ្ែរលយើងបានបលងកើតបូតុងពីរ CheckBox មួយ រួមទំង មាន Textfield ជាល្ចើនេ្មាប់លធវើការ ផ្កផ្្បតថ្មលណាមួយែូចជា ល្ម េះកូននំលោេះកូន្កមុំ កាលបរិលចេទ្យមងាលការ រួមទំងពាកយេមាៃ ត់នងផ្ែរ។ Figure 5: Form ផ្កផ្្បព៍ត៌មានអែកល្បើ្បាេ់  From េ្មាប់បញ្េូ លព័ត៌មានលភ្ៀវផ្ែល្តូវអលញ្ជើញ លៅកែុង Form លនេះផ្ែរលយើងបានបលងកើតបូតុងបួន ListView មួយ រួមទំង មាន Textfield ជាល្ចើនេ្មាប់លធវើការ បញ្េូ លតថ្មល និង ផ្េវងរកល្ម េះលភ្ៀវ ជាលែើម ។ លយើងអាចលធវើការ លុបទ្យិនែន័យផ្ែលបាន បញ្េូ លរួចនឹងអាចផ្កផ្្បទ្យិនែន័យបាននងផ្ែរ។ Figure 6: Form ព័ត៌មានលភ្ៀវ
  • 9.  From េ្មាប់កត់ចំែងថ្ែលភ្ៀវផ្ែលអលញ្ជើញចូលរួម លៅកែុង Form លនេះផ្ែរលយើងបានបលងកើតបូតុងបី ListView មួយ រួមទំង មាន Textfield ចំនួនបីេ្មាប់លធវើការ បញ្េូ លតថ្មល និង ផ្េវងរកល្ម េះលភ្ៀវ ជាលែើម ។ លយើងក៏បានបលងកើតជា Radio Button េ្មាប់ល្ជើេលរើេយកនូវ្បលភទ្យថ្នចំែងថ្ែមានែូចជា ្បាក់លរៀល ្បាក់ែុោល រ នឹង អំលណាយជាលែើម ែូចបាន បងាា ញកែុងរូបភាព្សាប់។ Figure 7: Form បញ្េូ លចំែងថ្ែលភ្ៀវ  From របាយការែ៏ លៅកែុង Form លនេះផ្ែរលយើងបានបលងកើត TextView ជាល្ចើនលែើមបីបងាា ញពីរបាយការែ៏ េរុបថ្ន មងាលការ។ Figure 8: Form របាយការែ៏
  • 10.  From អំពីពួកលយើង លៅកែុង Form លនេះផ្ែរលយើងបានបលងកើត TextView ជាល្ចើនេ្មាប់បងាា ញព័ត៌មានែូចខាងល្កាម។ Figure 9: Form អំពីពួកលយើង  From ជំនួយ លៅកែុង Form លនេះផ្ែរលយើងបានបលងកើត TextView ជាល្ចើនេ្មាប់បងាា ញព័ត៌មានែូចខាងល្កាម។ Figure 10: Form ជំនួយ
  • 11. 3. Implement ចំលពាេះការ Implement លៅលលើកមមវិធីលនេះលោយមានការល្បើ Eclipse IDE ជាជំនួយលធវើឲ្យការេរលេរកូែ បានកាន់ផ្ត្បលេើរជាងមុន។  From ែំបូងលពលលបើកកមមវិធី public frmWelcome() { setResizable(false); setUndecorated(true);//Remove Title bar setLocationRelativeTo(null); Operators ops=new Operators(); //----- Set Form Center Screen-------- int width=996,height=513; Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); int x = (screen.width - width) / 2; int y = (screen.height - height) / 2; setBounds(x, y, width, height); //------------------------------------ contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JButton btnNewButton = new JButton(""); btnNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { System.exit(0); } }); btnNewButton.setFont(new Font("Tahoma", Font.PLAIN, 10)); btnNewButton.setBounds(963, 0, 34, 30); btnNewButton.setIcon(newImageIcon(this.getClass().getResource("/close .png"))); btnNewButton.setBackground(null); btnNewButton.setOpaque(false); btnNewButton.setContentAreaFilled(false); btnNewButton.setBorderPainted(false); contentPane.add(btnNewButton); btnStart=new JButton(); btnStart.setBounds(388, 252, 207, 188); btnStart.setBackground(null); btnStart.setOpaque(false); btnStart.setContentAreaFilled(false); btnStart.setBorderPainted(false); btnStart.setIcon(new ImageIcon(this.getClass().getResource("/btnStart.png"))); btnStart.addMouseListener(new MouseAdapter() { @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub
  • 12. btnStart.setIcon(new ImageIcon(this.getClass().getResource("/btnStart1.png"))); } @Override public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub new FrmLogin().setVisible(true); dispose(); } @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub btnStart.setIcon(new ImageIcon(this.getClass().getResource("/btnStart.png"))); } }); contentPane.add(btnStart); JButton btnNewButton_1 = new JButton("ជំនួយ"); btnNewButton_1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { new frmHelp().setVisible(true); } }); btnNewButton_1.setHorizontalAlignment(SwingConstants.LEFT); btnNewButton_1.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 12)); btnNewButton_1.setBounds(907, 30, 61, 30); contentPane.add(btnNewButton_1); JLabel lblNewLabel = new JLabel(""); lblNewLabel.setBounds(0, 0, 997, 518); lblNewLabel.setIcon(new ImageIcon(this.getClass().getResource("/welcome.png"))); contentPane.add(lblNewLabel); }  Form បលងកើតទ្យិនែន័យ public frmUser() { setType(Type.POPUP); setTitle("User Account"); setUndecorated(true);//Remove Title //----- Set Form Center Screen-------- int width=675,height=470; Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); int x = (screen.width - width) / 2; int y = (screen.height - height) / 2; setBounds(x, y, width, height); //------------------------------------ contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JLabel lblNewLabel = new JLabel("កូនប្រុសនាម"); lblNewLabel.setForeground(new Color(210, 105, 30));
  • 13. lblNewLabel.setFont(new Font("Khmer OS Siemreap", Font.PLAIN, 16)); lblNewLabel.setBounds(51, 242, 94, 34); contentPane.add(lblNewLabel); JLabel label = new JLabel("ពាកយសំងាត់"); label.setForeground(new Color(210, 105, 30)); label.setFont(new Font("Khmer OS Siemreap", Font.PLAIN, 16)); label.setBounds(46, 373, 94, 21); contentPane.add(label); JLabel label_1 = new JLabel("កូនស្សីនាម"); label_1.setForeground(new Color(210, 105, 30)); label_1.setFont(new Font("Khmer OS Siemreap", Font.PLAIN, 16)); label_1.setBounds(51, 284, 94, 34); contentPane.add(label_1); JLabel label_2 = new JLabel("កាលររិច្ឆេទអាពាហ៍ពិពាហ៍"); label_2.setForeground(new Color(210, 105, 30)); label_2.setFont(new Font("Khmer OS Siemreap", Font.PLAIN, 16)); label_2.setBounds(47, 323, 166, 39); contentPane.add(label_2); JLabel lblNewLabel_1 = new JLabel("រច្្កើតទិននន័យថ្មី"); lblNewLabel_1.setBackground(new Color(210, 105, 30)); lblNewLabel_1.setForeground(new Color(210, 105, 30)); lblNewLabel_1.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 20)); lblNewLabel_1.setBounds(257, 205, 166, 40); contentPane.add(lblNewLabel_1); txtGName = new JTextField(); txtGName.setForeground(new Color(0, 0, 255)); txtGName.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 16)); txtGName.setBounds(223, 244, 285, 34); contentPane.add(txtGName); txtGName.setColumns(10); txtBName = new JTextField(); txtBName.setForeground(new Color(0, 0, 255)); txtBName.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 16)); txtBName.setColumns(10); txtBName.setBounds(223, 284, 285, 35); contentPane.add(txtBName); txtWeddingDate = new JTextField(); txtWeddingDate.setFont(new Font("Tahoma", Font.PLAIN, 12)); txtWeddingDate.setColumns(10); txtWeddingDate.setBounds(223, 325, 285, 35); contentPane.add(txtWeddingDate); btnCreate = new JButton(""); btnCreate.setBounds(518, 261, 132, 50); btnCreate.setOpaque(false); btnCreate.setContentAreaFilled(false); btnCreate.setBorderPainted(false);
  • 14. btnCreate.setIcon(new ImageIcon(this.getClass().getResource("/btnsave.png"))); btnCreate.addMouseListener(new MouseAdapter() { @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub btnCreate.setIcon(new ImageIcon(this.getClass().getResource("/btnsave.png"))); } @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub btnCreate.setIcon(new ImageIcon(this.getClass().getResource("/btnsave1.png"))); } @Override public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub String gn="'"+txtGName.getText()+"'"; String bn="'"+txtBName.getText()+"'"; String wd="'"+txtWeddingDate.getText()+"'"; String pw="'"+txtPassword.getText()+"'"; String nm="** សូមរញ្ជូ លច្្ម ោះ"; if (txtGName.getText().equals("")) { LbMessage.setText(nm + "កូនកំច្ ោះ **"); txtGName.requestFocus(); } else if (txtBName.getText().equals("")) { LbMessage.setText(nm + "កូនប្កមំ **"); txtBName.requestFocus(); } else if (txtWeddingDate.getText().equals("")) { LbMessage.setText("សូមរញ្ជូ លថ្ថ្ៃច្រៀរអាពាហ៏ពិពាហ៏..!"); txtWeddingDate.requestFocus(); } else if (txtPassword.getText().equals("")) { LbMessage.setText("សូមរញ្ជូ លពាកយសំងាត់ច្ ើមបីឆូលច្ប្រើប្ាស់"); txtPassword.requestFocus(); } else { Operators op = new Operators(); try { op.SetConnectionSql(); String sql = "Insert Into tbUser (GroomName,BrideName,WeddingDate, UserPassword) Values(N" + gn + ",N" + bn + "," + wd + "," + pw + ")"; int r = op.stmt.executeUpdate(sql); if (r == 1) { LbMessage.setText("សូមអរអរសាទរច្ កអនករច្្កើតទិននន័យានច្ោគជ័យ..!!"); } } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace();
  • 15. } } } }); contentPane.add(btnCreate); txtPassword = new JPasswordField(); txtPassword.setFont(new Font("Tahoma", Font.PLAIN, 12)); txtPassword.setBounds(223, 366, 285, 35); contentPane.add(txtPassword); btnClose = new JButton(""); btnClose.setOpaque(false); btnClose.setContentAreaFilled(false); btnClose.setBorderPainted(false); btnClose.setBounds(518, 322, 132, 50); btnClose.setIcon(newImageIcon(this.getClass().getResource("/btnExit1. png"))); btnClose.addMouseListener(new MouseListener() { @Override public void mouseReleased(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mousePressed(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub btnClose.setIcon(new ImageIcon(this.getClass().getResource("/btnExit1.png"))); } @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub btnClose.setIcon(new ImageIcon(this.getClass().getResource("/btnExit.png"))); } @Override public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub new FrmLogin().setVisible(true); dispose(); } }); LbMessage = new JLabel(""); LbMessage.setHorizontalAlignment(SwingConstants.CENTER); LbMessage.setForeground(new Color(255, 0, 0)); LbMessage.setFont(new Font("Khmer OS Siemreap", Font.PLAIN, 16)); LbMessage.setBounds(163, 412, 402, 34);
  • 16. contentPane.add(LbMessage); contentPane.add(btnClose); JLabel label_3 = new JLabel(""); label_3.setFont(new Font("Khmer OS Siemreap", Font.PLAIN, 16)); label_3.setBounds(0, 0, 675, 471); label_3.setIcon(new ImageIcon(this.getClass().getResource("/BackUser.png"))); contentPane.add(label_3); }  Form េ្មាប់ចូលល្បើ្បាេ់កមមវិធី public FrmLogin() { setType(Type.POPUP); setResizable(false); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //----- Set Form Center Screen-------- int width=468,height=339; Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); int x = (screen.width - width) / 2; int y = (screen.height - height) / 2; setBounds(x, y, 468, 340); //------------------------------------ contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); txtPassLogin = new JPasswordField(); txtPassLogin.setOpaque(false); //passwordField.setContentAreaFilled(false); //passwordField.setBorderPainted(false); txtPassLogin.setFont(new Font("Tahoma", Font.PLAIN, 20)); txtPassLogin.setBounds(38, 187, 377, 38); contentPane.add(txtPassLogin); btnLogin= new JButton(""); btnLogin.setOpaque(false); btnLogin.setContentAreaFilled(false); btnLogin.setBorderPainted(false); btnLogin.setIcon(new ImageIcon(this.getClass().getResource("/btnlogin.png"))); btnLogin.addMouseListener(new MouseAdapter() { @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub btnLogin.setIcon(new ImageIcon(this.getClass().getResource("/btnlogin.png"))); } @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub btnLogin.setIcon(new ImageIcon(this.getClass().getResource("/btnlogin1.png"))); }
  • 17. @Override public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub if (n == 5) { JOptionPane.showMessageDialog(null, "Goodbye!"); System.exit(0); } else { if (txtPassLogin.getText().equals("")) { LbMessage.setText("រញ្ជូ លពាកយសំងាត់..!!"); txtPassLogin.requestFocus(); n = n + 1; } else { if (txtPassLogin.getText().equals(txtPass.getText())) { LbMessage.setText(""); new FrmManu().setVisible(true); dispose(); } else { LbMessage.setText("រញ្ជូ លពាកយសំងាត់ខស សូមពាយាមមដ្ច្ទៀត!"); LbMessage.requestFocus(); n = n + 1; } } } } }); btnLogin.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 18)); btnLogin.setBounds(38, 235, 136, 44); contentPane.add(btnLogin); LbMessage = new JLabel(""); LbMessage.setHorizontalAlignment(SwingConstants.CENTER); LbMessage.setForeground(Color.RED); LbMessage.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 13)); LbMessage.setBounds(38, 278, 377, 33); contentPane.add(LbMessage); btnCreate = new JButton(""); btnCreate.setOpaque(false); btnCreate.setEnabled(true); btnCreate.setContentAreaFilled(false); btnCreate.setBorderPainted(false); btnCreate.setBounds(279, 235, 130, 44); btnCreate.setIcon(new ImageIcon(this.getClass().getResource("/btnCreate.png"))); btnCreate.addMouseListener(new MouseAdapter() { @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub btnCreate.setIcon(new ImageIcon(this.getClass().getResource("/btnCreate.png"))); }
  • 18. @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub btnCreate.setIcon(new ImageIcon(this.getClass().getResource("/btncreate1.png"))); } @Override public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub new frmUser().setVisible(true); dispose(); } }); contentPane.add(btnCreate); JLabel label = new JLabel(""); label.setBounds(0, 0, 457, 311); label.setIcon(new ImageIcon(this.getClass().getResource("/login.png"))); contentPane.add(label); txtPass = new JTextField(); txtPass.setVisible(false); txtPass.setBounds(10, 118, 102, 20); contentPane.add(txtPass); txtPass.setColumns(10); String sql="Select UserPassword from tbUser"; Operators op=new Operators(); try { op.SetConnectionSql(); op.rs=op.stmt.executeQuery(sql); while(op.rs.next()){ btnCreate.setEnabled(false); txtPass.setText(op.rs.getString(1)); txtPass.setVisible(false); } } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } }  Form Main public FrmManu() { setUndecorated(true);// Remove Title bar setResizable(false); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); //----- Set Form Center Screen-------- int width=1383,height=780; Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); int x = (screen.width - width) / 2; int y = (screen.height - height) / 2; setBounds(x, y, width, height);
  • 19. contentPane.setLayout(null); JButton btnExit = new JButton(""); btnExit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { dispose(); } }); JButton button = new JButton(""); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { } }); btnExit.setBounds(1312, 723, 49, 57); btnExit.setOpaque(false); btnExit.setContentAreaFilled(false); btnExit.setBorderPainted(false); btnExit.setIcon(new ImageIcon(this.getClass().getResource("/Exit.png"))); contentPane.add(btnExit); JLabel label_1 = new JLabel("ព័ត៌មានអនកច្ប្រើប្ាស់"); label_1.setBackground(Color.MAGENTA); label_1.setForeground(Color.BLUE); label_1.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20)); label_1.setBounds(134, 403, 220, 51); contentPane.add(label_1); btnNewButton = new JButton(""); btnNewButton.setBounds(166, 229, 162, 177); btnNewButton.setIcon(new ImageIcon(this.getClass().getResource("/user5.png"))); btnNewButton.setOpaque(false); btnNewButton.setContentAreaFilled(false); btnNewButton.setBorderPainted(false); btnNewButton.addMouseListener(new MouseListener() { @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub btnNewButton.setIcon(new ImageIcon(this.getClass().getResource("/user5.png"))); } @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub btnNewButton.setIcon(new ImageIcon(this.getClass().getResource("/user3.png"))); } @Override public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub new frmUserUpdate().setVisible(true); } @Override public void mousePressed(MouseEvent e) { // TODO Auto-generated method stub
  • 20. } @Override public void mouseReleased(MouseEvent e) { // TODO Auto-generated method stub } }); contentPane.add(btnNewButton); btnGuest = new JButton(""); btnGuest.setOpaque(false); btnGuest.setContentAreaFilled(false); btnGuest.setBorderPainted(false); btnGuest.setBounds(1023, 235, 162, 177); btnGuest.setIcon(new ImageIcon(this.getClass().getResource("/guest.png"))); btnGuest.addMouseListener(new MouseListener() { @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub btnGuest.setIcon(new ImageIcon(this.getClass().getResource("/guest.png"))); } @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub btnGuest.setIcon(new ImageIcon(this.getClass().getResource("/guest1.png"))); } @Override public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub new frmGuestUpdate().setVisible(true); } @Override public void mousePressed(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseReleased(MouseEvent e) { // TODO Auto-generated method stub } }); contentPane.add(btnGuest); JLabel label_2 = new JLabel("ព័ត៌មានច្្ញៀវឆូលរួម"); label_2.setForeground(Color.BLUE); label_2.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20)); label_2.setBackground(Color.MAGENTA); label_2.setBounds(1023, 409, 213, 57); contentPane.add(label_2); btnInvite = new JButton(""); btnInvite.setOpaque(false);
  • 21. btnInvite.setContentAreaFilled(false); btnInvite.setBorderPainted(false); btnInvite.setBounds(618, 229, 162, 177); btnInvite.setIcon(new ImageIcon(this.getClass().getResource("/invite2.png"))); btnInvite.addMouseListener(new MouseListener() { @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub btnInvite.setIcon(new ImageIcon(this.getClass().getResource("/invite2.png"))); } @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub btnInvite.setIcon(new ImageIcon(this.getClass().getResource("/invite1.png"))); } @Override public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub new frmGuest().setVisible(true); } @Override public void mousePressed(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseReleased(MouseEvent e) { // TODO Auto-generated method stub } }); contentPane.add(btnInvite); JLabel label_3 = new JLabel("ព័ត៌មានអច្ញ្ជ ើញច្្ញៀវ"); label_3.setForeground(Color.BLUE); label_3.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20)); label_3.setBackground(Color.MAGENTA); label_3.setBounds(607, 404, 220, 51); contentPane.add(label_3); btnReport = new JButton(""); btnReport.setOpaque(false); btnReport.setContentAreaFilled(false); btnReport.setBorderPainted(false); btnReport.setBounds(166, 465, 162, 177); btnReport.setIcon(new ImageIcon(this.getClass().getResource("/report.png"))); btnReport.addMouseListener(new MouseListener() { @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub btnReport.setIcon(new ImageIcon(this.getClass().getResource("/report.png"))); }
  • 22. @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub btnReport.setIcon(new ImageIcon(this.getClass().getResource("/report1.png"))); } @Override public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub new frmReport().setVisible(true); } @Override public void mousePressed(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseReleased(MouseEvent e) { // TODO Auto-generated method stub } }); contentPane.add(btnReport); JLabel label_4 = new JLabel("រាយការណ៏ សររ"); label_4.setForeground(Color.BLUE); label_4.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20)); label_4.setBackground(Color.MAGENTA); label_4.setBounds(159, 644, 195, 57); contentPane.add(label_4); JLabel label_5 = new JLabel("កមមវិធីកត់ប្ាឆំណ្ថ្ អាពាហ៏ពិពាហ៏ច្នោះរច្្កើតច្ ើ្ច្ោយប្កុមនិសិតសថ្នសាកលវិទាល័យ្ូមិ នទ្នំច្ពញ ជំនាន់ទី ១៧ ឆ្ន ំ ២០១៦"); label_5.setForeground(new Color(0, 0, 205)); label_5.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20)); label_5.setBackground(Color.MAGENTA); label_5.setBounds(30, 732, 1272, 37); contentPane.add(label_5); JLabel label_6 = new JLabel("អំពីពួកច្យើ្"); label_6.setForeground(Color.BLUE); label_6.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20)); label_6.setBackground(Color.MAGENTA); label_6.setBounds(651, 650, 142, 57); contentPane.add(label_6); btnAbout = new JButton(""); btnAbout.setOpaque(false); btnAbout.setContentAreaFilled(false); btnAbout.setBorderPainted(false); btnAbout.setBounds(625, 471, 162, 177); btnAbout.setIcon(new ImageIcon(this.getClass().getResource("/about1.png"))); btnAbout.addMouseListener(new MouseListener() { @Override
  • 23. public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub btnAbout.setIcon(new ImageIcon(this.getClass().getResource("/about1.png"))); } @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub btnAbout.setIcon(new ImageIcon(this.getClass().getResource("/about.png"))); } @Override public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub new frmAbout().setVisible(true); } @Override public void mousePressed(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseReleased(MouseEvent e) { // TODO Auto-generated method stub } }); contentPane.add(btnAbout); JLabel label_7 = new JLabel("ជំនួយ"); label_7.setForeground(Color.BLUE); label_7.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20)); label_7.setBackground(Color.MAGENTA); label_7.setBounds(1075, 664, 130, 57); contentPane.add(label_7); btnHelp = new JButton(""); btnHelp.setOpaque(false); btnHelp.setContentAreaFilled(false); btnHelp.setBorderPainted(false); btnHelp.setBounds(1033, 485, 162, 177); btnHelp.setIcon(new ImageIcon(this.getClass().getResource("/help.png"))); btnHelp.addMouseListener(new MouseListener() { @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub btnHelp.setIcon(new ImageIcon(this.getClass().getResource("/help.png"))); } @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub btnHelp.setIcon(new ImageIcon(this.getClass().getResource("/help1.png"))); }
  • 24. @Override public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub new frmHelp().setVisible(true); } @Override public void mousePressed(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseReleased(MouseEvent e) { // TODO Auto-generated method stub } }); contentPane.add(btnHelp); JLabel LbGName = new JLabel("ព័ត៌មានអច្ញ្ជ ើញច្្ញៀវ"); LbGName.setHorizontalAlignment(SwingConstants.RIGHT); LbGName.setForeground(new Color(255, 255, 255)); LbGName.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20)); LbGName.setBackground(Color.MAGENTA); LbGName.setBounds(397, 100, 220, 51); contentPane.add(LbGName); JLabel LbBrName = new JLabel("ព័ត៌មានអច្ញ្ជ ើញច្្ញៀវ"); LbBrName.setHorizontalAlignment(SwingConstants.LEFT); LbBrName.setForeground(new Color(255, 255, 255)); LbBrName.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20)); LbBrName.setBackground(Color.MAGENTA); LbBrName.setBounds(771, 100, 220, 51); contentPane.add(LbBrName); JLabel LbDate = new JLabel("ព័ត៌មានអច្ញ្ជ ើញច្្ញៀវ"); LbDate.setHorizontalAlignment(SwingConstants.RIGHT); LbDate.setForeground(Color.WHITE); LbDate.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20)); LbDate.setBackground(Color.MAGENTA); LbDate.setBounds(1135, 100, 207, 51); contentPane.add(LbDate); JLabel LbWeddingDate = new JLabel("ព័ត៌មានអច្ញ្ជ ើញច្្ញៀវ"); LbWeddingDate.setForeground(Color.WHITE); LbWeddingDate.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20)); LbWeddingDate.setBackground(Color.MAGENTA); LbWeddingDate.setBounds(51, 100, 220, 51); contentPane.add(LbWeddingDate); JLabel label_8 = new JLabel("ថ្ថ្ៃច្រៀរអាពាហ៏ពិពាហ៏"); label_8.setForeground(Color.WHITE); label_8.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20)); label_8.setBackground(Color.MAGENTA); label_8.setBounds(41, 59, 226, 51); contentPane.add(label_8);
  • 25. JLabel label_10 = new JLabel("ថ្ថ្ៃច្នោះ"); label_10.setForeground(Color.WHITE); label_10.setFont(new Font("Khmer OS Muol", Font.PLAIN, 20)); label_10.setBackground(Color.MAGENTA); label_10.setBounds(1242, 59, 100, 51); contentPane.add(label_10); JLabel label = new JLabel(""); label.setIcon(new ImageIcon(this.getClass().getResource("/MainForm.png"))); label.setBounds(0, 0, 1378, 780); contentPane.add(label); //---------====== dateFormat = new SimpleDateFormat("dd-MMM-YYYY"); Calendar cal = Calendar.getInstance(); LbDate.setText(dateFormat.format(cal.getTime())); //2014/08/06 //=========Select Groom and BrideName Operators op=new Operators(); String sql="Select * from tbUser"; try { op.SetConnectionSql(); op.rs=op.stmt.executeQuery(sql); while(op.rs.next()){ LbGName.setText(op.rs.getString(2)); LbBrName.setText(op.rs.getString(3)); LbWeddingDate.setText(op.rs.getString(4)); String text=LbWeddingDate.getText(); DateFormat df = new SimpleDateFormat("dd/MM/yyyy"); // Date today = df.parse("20/12/2005"); } } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } }  Form េ្មាប់ផ្កផ្្បព័ត៌មានអែកល្បើ្បាេ់ public frmUserUpdate() { setType(Type.POPUP); setUndecorated(true);//Remove Title //----- Set Form Center Screen-------- int width=683,height=502; Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); int x = (screen.width - width) / 2; int y = (screen.height - height) / 2; setBounds(x, y, 677, 482); //------------------------------------ contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JLabel lblNewLabel = new JLabel("កូនប្រុសនាម ");
  • 26. lblNewLabel.setForeground(new Color(210, 105, 30)); lblNewLabel.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 14)); lblNewLabel.setBounds(33, 251, 94, 25); contentPane.add(lblNewLabel); lbPass = new JLabel("ពាកយសំងាត់ចាស់"); lbPass.setForeground(new Color(210, 105, 30)); lbPass.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 14)); lbPass.setBounds(33, 341, 94, 25); contentPane.add(lbPass); JLabel label_1 = new JLabel("កូនស្សីនាម"); label_1.setForeground(new Color(210, 105, 30)); label_1.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 14)); label_1.setBounds(33, 281, 94, 25); contentPane.add(label_1); JLabel label_2 = new JLabel("កាលររិច្ឆជទអាពាហ៍ពិពាហ៍"); label_2.setForeground(new Color(210, 105, 30)); label_2.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 14)); label_2.setBounds(33, 311, 166, 26); contentPane.add(label_2); JLabel lblNewLabel_1 = new JLabel("ព័ត៌មានររស់អនកច្ប្រើប្ាស់"); lblNewLabel_1.setHorizontalAlignment(SwingConstants.CENTER); lblNewLabel_1.setForeground(new Color(210, 105, 30)); lblNewLabel_1.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 20)); lblNewLabel_1.setBounds(185, 209, 318, 40); contentPane.add(lblNewLabel_1); txtGName = new JTextField(); txtGName.setFont(new Font("Khmer OS", Font.PLAIN, 11)); txtGName.setBounds(185, 251, 318, 26); contentPane.add(txtGName); txtGName.setColumns(10); txtBName = new JTextField(); txtBName.setFont(new Font("Khmer OS", Font.PLAIN, 11)); txtBName.setColumns(10); txtBName.setBounds(185, 281, 318, 27); contentPane.add(txtBName); txtWeddingDate = new JTextField(); txtWeddingDate.setColumns(10); txtWeddingDate.setBounds(185, 311, 318, 27); contentPane.add(txtWeddingDate); txtNewPassword = new JPasswordField(); txtNewPassword.setBounds(185, 373, 318, 27); contentPane.add(txtNewPassword); LbNewPass = new JLabel("ពាកយសំងាត់ថ្មី"); LbNewPass.setForeground(new Color(210, 105, 30));
  • 27. LbNewPass.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 14)); LbNewPass.setBounds(33, 377, 94, 23); contentPane.add(LbNewPass); txtConfirmPassword = new JPasswordField(); txtConfirmPassword.setBounds(185, 404, 318, 27); contentPane.add(txtConfirmPassword); lbConPass = new JLabel("រញ្ជជ ក់ពាកយសំងាត់ថ្មី"); lbConPass.setForeground(new Color(210, 105, 30)); lbConPass.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 14)); lbConPass.setBounds(33, 404, 142, 27); contentPane.add(lbConPass); checkBox = new JCheckBox("រដូរពាកយសំងាត់"); checkBox.setBackground(new Color(245, 245, 245)); checkBox.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 15)); checkBox.setBounds(523, 355, 108, 43); checkBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub if(checkBox.isSelected()==true){ SetVisibleButton(true); } else SetVisibleButton(false); } }); contentPane.add(checkBox); txtPassword = new JPasswordField(); txtPassword.setColumns(10); txtPassword.setBounds(185, 341, 318, 27); contentPane.add(txtPassword); btnSave= new JButton(""); btnSave.setOpaque(false); btnSave.setContentAreaFilled(false); btnSave.setBorderPainted(false); btnSave.setIcon(new ImageIcon(this.getClass().getResource("/btnsave.png"))); btnSave.setBounds(513, 251, 132, 46); btnSave.addMouseListener(new MouseListener() { @Override public void mouseReleased(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mousePressed(MouseEvent e) { // TODO Auto-generated method stub }
  • 28. @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub btnSave.setIcon(new ImageIcon(this.getClass().getResource("/btnsave.png"))); } @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub btnSave.setIcon(new ImageIcon(this.getClass().getResource("/btnsave1.png"))); } @Override public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub String gn,bn,wd,pw,oldPw,NewPassw,NewConf; gn="'"+txtGName.getText()+"'"; bn="'"+txtBName.getText()+"'"; wd="'"+txtWeddingDate.getText()+"'"; pw="'"+txtPassword.getText()+"'"; oldPw="'"+textoldPass.getText()+"'"; NewPassw="'"+txtNewPassword.getText()+"'"; NewConf="'"+txtConfirmPassword.getText()+"'"; String id="'"+textid.getText()+"'"; if(checkBox.isSelected()==true){ if(pw.equals(oldPw)){ if(NewPassw.equals(NewConf)){ sql="Update tbUser set GroomName=N"+ gn +", BrideName=N"+ bn+", WeddingDate="+wd+", UserPassword="+NewPassw +" where UserID="+id; ops.updateData(sql); } else JOptionPane.showMessageDialog(null,"Confirm New Password id wrong!"); } else JOptionPane.showMessageDialog(null,"Wrong Old Password id wrong!"); } else { // if they only want to change Name and WeddingDate sql="Update tbUser set GroomName=N"+ gn +", BrideName=N"+ bn+", WeddingDate="+wd+" where UserID="+id; ops.updateData(sql); } } }); contentPane.add(btnSave); btnExit = new JButton(""); btnExit.setOpaque(false); btnExit.setContentAreaFilled(false); btnExit.setBorderPainted(false); btnExit.setBounds(513, 302, 132, 46);
  • 29. btnExit.setIcon(new ImageIcon(this.getClass().getResource("/btnExit1.png"))); btnExit.addMouseListener(new MouseListener() { @Override public void mouseReleased(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mousePressed(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub btnExit.setIcon(new ImageIcon(this.getClass().getResource("/btnExit1.png"))); } @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub btnExit.setIcon(new ImageIcon(this.getClass().getResource("/btnExit.png"))); } @Override public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub dispose(); } }); contentPane.add(btnExit); JLabel label_3 = new JLabel(""); label_3.setBounds(0, -11, 688, 507); label_3.setIcon(new ImageIcon(this.getClass().getResource("/Backuser.png"))); contentPane.add(label_3); textid = new JTextField(); textid.setBounds(536, 380, 86, 20); contentPane.add(textid); textid.setColumns(10); textoldPass = new JTextField(); textoldPass.setBounds(536, 407, 86, 20); contentPane.add(textoldPass); textoldPass.setColumns(10); ///==========Get Data to TextField==================== try { ops.SetConnectionSql(); sql="select * from tbUser"; ops.rs=ops.stmt.executeQuery(sql); while(ops.rs.next()){ txtGName.setText(ops.rs.getString(2)); txtBName.setText(ops.rs.getString(3)); txtWeddingDate.setText(ops.rs.getString(4)); textid.setText(ops.rs.getString(1)); textoldPass.setText(ops.rs.getString(5)); }
  • 30. ops.rs.close(); ops.stmt.close(); // ops.con.close(); } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } //===================================================== SetVisibleButton(false);///Call function } public void SetVisibleButton(boolean b) { txtPassword.setVisible(b); txtNewPassword.setVisible(b); txtConfirmPassword.setVisible(b); lbPass.setVisible(b); lbConPass.setVisible(b); LbNewPass.setVisible(b);; textid.setVisible(false); textoldPass.setVisible(false); }  Form េ្មាប់បញ្េូ លព័ត៌មានលភ្ៀវផ្ែល្តូវអលញ្ជើញ public frmGuest() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 1180, 619); setLocationRelativeTo(null); setUndecorated(true); contentPane = new JPanel(); contentPane.setForeground(Color.BLACK); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); addWindowListener(this); JLabel lbName = new JLabel("ច្្ម ោះច្្ញៀវ"); lbName.setForeground(new Color(153, 50, 204)); lbName.setFont(new Font("Khmer OS Muol Light", Font.BOLD, 14)); lbName.setBounds(20, 278, 94, 29); contentPane.add(lbName); txtName = new JTextField(); txtName.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent arg0) { if(txtName.getText()!="")lbMess.setText(""); } }); txtName.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 14)); txtName.setBounds(154, 278, 228, 32); contentPane.add(txtName); txtName.setColumns(10); JLabel lbTitle = new JLabel("ងារ"); lbTitle.setForeground(new Color(153, 50, 204)); lbTitle.setFont(new Font("Khmer OS Muol Light", Font.BOLD, 14)); lbTitle.setBounds(20, 324, 94, 29);
  • 31. contentPane.add(lbTitle); lbAddress = new JLabel("អាស័យោា ន"); lbAddress.setForeground(new Color(153, 50, 204)); lbAddress.setFont(new Font("Khmer OS Muol Light", Font.BOLD, 14)); lbAddress.setBounds(20, 363, 94, 29); contentPane.add(lbAddress); txtAddress = new JTextArea(); txtAddress.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { if(txtAddress.getText()!="")lbMess.setText(""); } }); txtAddress.setWrapStyleWord(true); txtAddress.setLineWrap(true); txtAddress.setColumns(1); txtAddress.setRows(3); txtAddress.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 14)); txtAddress.setBounds(154, 364, 228, 85); contentPane.add(txtAddress); cboTitle = new JComboBox(); cboTitle.addMouseListener(new MouseAdapter() { @Override public void mouseEntered(MouseEvent arg0) { lbMess.setText(""); } }); cboTitle.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 14)); cboTitle.setModel(new DefaultComboBoxModel(new String[] {"សច្មដឆ", "ឯកឧតដម", "ច្ កជំទាវ", "ច្ កឧកញ៉ា ", "អនកឧកញ៉ា ", "ច្ ក", "ច្ កស្សី", "អនកនា្", "កញ្ជា "})); cboTitle.setBounds(154, 321, 228, 32); cboTitle.setSelectedIndex(-1); contentPane.add(cboTitle); JPanel panel = new JPanel(); panel.setBackground(new Color(224, 255, 255));  panel.setForeground(new Color(127, 255, 212));  panel.setBounds(430, 211, 729, 386); contentPane.add(panel); panel.setLayout(null); model=new DefaultTableModel(); model.addColumn("កូ "); model.addColumn("ច្្ម ោះ"); model.addColumn("ងារ"); model.addColumn("អាស័យោា ន"); tbGuest = new JTable(model); tbGuest.getColumnModel().getColumn(0).setMinWidth(0);
  • 32. tbGuest.getColumnModel().getColumn(0).setMaxWidth(0); tbGuest.getColumnModel().getColumn(0).setWidth(0); tbGuest.setRowHeight(25); tbGuest.getTableHeader().setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 18)); tbGuest.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 14)); tbGuest.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { getID=(int) tbGuest.getValueAt(tbGuest.getSelectedRow(), 0); String nm=(String) tbGuest.getValueAt(tbGuest.getSelectedRow(), 1); String ti=(String) tbGuest.getValueAt(tbGuest.getSelectedRow(), 2); String ad=(String) tbGuest.getValueAt(tbGuest.getSelectedRow(), 3); txtName.setText(nm); cboTitle.setSelectedItem(ti); txtAddress.setText(ad); lbMess.setText(""); status="Old"; enabledButton(true); } }); int v = ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED; int h = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED; jsp=new JScrollPane(tbGuest,v,h); jsp.setBounds(20, 54, 690, 317); panel.add(jsp); txtSearch = new JTextField(); txtSearch.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { try{ int rc= model.getRowCount(); for(int j = 0;j<rc;j++){ model.removeRow(0); } String sql="Select * From tbGuest Where Name Like N'%"+ txtSearch.getText() + "%'"+"Collate Khmer_100_Bin"; try { rs=stmt.executeQuery(sql); while(rs.next()){ int code=rs.getInt(1); String nm=rs.getString(2); String ti=rs.getString(3); String ad=rs.getString(4); Object[] obj={code,nm,ti,ad}; model.addRow(obj); } } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } getID=(int) tbGuest.getValueAt(0, 0);
  • 33. String nm=(String) tbGuest.getValueAt(0, 1); String ti=(String) tbGuest.getValueAt(0, 2); String ad=(String) tbGuest.getValueAt(0, 3); txtName.setText(nm); cboTitle.setSelectedItem(ti); txtAddress.setText(ad); enabledButton(true); }catch(Exception exc){} } }); txtSearch.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 14)); txtSearch.setColumns(10); txtSearch.setBounds(354, 11, 226, 32); panel.add(txtSearch); JLabel lbSearch = new JLabel("ស្សែ្រកាមច្្ម ោះ"); lbSearch.setForeground(new Color(255, 0, 255)); lbSearch.setFont(new Font("Khmer OS Fasthand", Font.BOLD, 15)); lbSearch.setBounds(162, 12, 158, 29); panel.add(lbSearch); btnSave = new JButton(""); btnSave.setBounds(138, 503, 85, 35); btnSave.setOpaque(false); btnSave.setContentAreaFilled(false); btnSave.setBorderPainted(false); btnSave.setIcon(new ImageIcon(this.getClass().getResource("/btnSave2.png"))); btnSave.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub if (txtName.getText().equals("")) { lbMess.setText("សួមរញ្ជូ លច្្ម ោះច្្ញៀវ..!"); txtName.requestFocus(); } else if (cboTitle.getSelectedItem()==null) { lbMess.setText("សួមរញ្ជូ លងារររស់ច្្ញៀវ..!"); cboTitle.requestFocus(); } else if (txtAddress.getText().equals("")) { lbMess.setText("សួមរញ្ជូ លអស័យោា នររស់ច្្ញៀវ..!"); txtAddress.requestFocus(); } else { String nm="'"+txtName.getText()+"'"; String ti="'"+cboTitle.getSelectedItem()+"'"; String ad="'"+txtAddress.getText()+"'"; if(status.equals("New")) { String sql="Insert Into tbGuest (Name,Title,Address) Values(N"+ nm+",N"+ ti+",N"+ad+")"; int r=0; try { r = stmt.executeUpdate(sql); } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace();
  • 34. } if(r==1){ lbMess.setText("អរ់អរសាទរ! ច្ កអនករញ្ជូ លទិននន័យានច្ោគជ័យ..!"); int rc= model.getRowCount(); for(int i = 0;i<rc;i++){ model.removeRow(0); } windowOpened(null); } } else if(status.equals("Old")){ String sql="Update tbGuest Set Name=N"+nm+", Title=N"+ti+", Address=N"+ad+" Where Code="+ getID; int r=0; try { r = stmt.executeUpdate(sql); } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } if(r==1){ lbMess.setText("អរ់អរសាទរ! ច្ កអនកានស្កស្ប្រទិននន័យានច្ោគជ័យ..!"); int rc= model.getRowCount(); for(int i = 0;i<rc;i++){ model.removeRow(0); } windowOpened(null); } } } } @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub btnSave.setIcon(new ImageIcon(this.getClass().getResource("/btnSave3.png"))); } @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub btnSave.setIcon(new ImageIcon(this.getClass().getResource("/btnSave2.png"))); } }); contentPane.add(btnSave); btnNew = new JButton(""); btnNew.setBounds(254, 503, 85, 35); btnNew.setOpaque(false); btnNew.setContentAreaFilled(false); btnNew.setBorderPainted(false); btnNew.setIcon(new ImageIcon(this.getClass().getResource("/btnNew.png"))); btnNew.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) {
  • 35. // TODO Auto-generated method stub clearData(); status="New"; txtName.requestFocus(); enabledButton(true); lbMess.setText(""); } @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub btnNew.setIcon(new ImageIcon(this.getClass().getResource("/btnNew1.png"))); } @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub btnNew.setIcon(new ImageIcon(this.getClass().getResource("/btnNew.png"))); } }); contentPane.add(btnNew); btnDelete = new JButton(""); btnDelete.setBounds(138, 549, 85, 35); btnDelete.setOpaque(false); btnDelete.setContentAreaFilled(false); btnDelete.setBorderPainted(false); btnDelete.setIcon(new ImageIcon(this.getClass().getResource("/btnDelete.png"))); btnDelete.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub int i=0; i=JOptionPane.showConfirmDialog(null, "Do you want to close?"); if(i==0){ String sql="Delete From tbGuest Where Code="+getID; int r=0; try { r = stmt.executeUpdate(sql); } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } if(r==1){ lbMess.setText("ច្ កអនកលរទិននន័យានច្ោគជ័យ..!!"); int rc= model.getRowCount(); for(int j = 0;j<rc;j++){ model.removeRow(0); } clearData(); windowOpened(null); } } }
  • 36. @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub btnDelete.setIcon(new ImageIcon(this.getClass().getResource("/btnDelete1.png"))); } @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub btnDelete.setIcon(new ImageIcon(this.getClass().getResource("/btnDelete.png"))); } }); contentPane.add(btnDelete); btnExit = new JButton(""); btnExit.setBounds(254, 549, 85, 35); btnExit.setOpaque(false); btnExit.setContentAreaFilled(false); btnExit.setBorderPainted(false); btnExit.setIcon(new ImageIcon(this.getClass().getResource("/btnExit2.png"))); btnExit.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub dispose(); } @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub btnExit.setIcon(new ImageIcon(this.getClass().getResource("/btnExit3.png")));; } @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub btnExit.setIcon(new ImageIcon(this.getClass().getResource("/btnExit2.png"))); } }); btnExit.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 14)); contentPane.add(btnExit); label = new JLabel("សូមរញ្ចូ លពត័មានររស់ច្្ញៀវ"); label.setForeground(new Color(0, 255, 0)); label.setFont(new Font("Khmer OS Muol Light", Font.BOLD, 22)); label.setBounds(46, 227, 336, 51); contentPane.add(label); lbGroom = new JLabel("New label"); lbGroom.setHorizontalAlignment(SwingConstants.CENTER); lbGroom.setForeground(Color.ORANGE); lbGroom.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 18)); lbGroom.setBounds(397, 135, 126, 29); contentPane.add(lbGroom); lbBride = new JLabel("New label"); lbBride.setHorizontalAlignment(SwingConstants.CENTER);
  • 37. lbBride.setForeground(Color.ORANGE); lbBride.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 18)); lbBride.setBounds(650, 135, 126, 29); contentPane.add(lbBride); lbMess = new JLabel(""); lbMess.setForeground(Color.RED); lbMess.setHorizontalAlignment(SwingConstants.CENTER); lbMess.setFont(new Font("Khmer OS Bokor", Font.PLAIN, 14)); lbMess.setBounds(46, 460, 336, 32); contentPane.add(lbMess); JLabel lbPicture = new JLabel("New label"); lbPicture.setBounds(0, 0, 1179, 619); contentPane.add(lbPicture); lbPicture.setIcon(new ImageIcon(this.getClass().getResource("/BGuest.png"))); setVisible(true); }  Form េ្មាប់កត់ចំែងថ្ែលភ្ៀវផ្ែលអលញ្ជើញចូលរួម public frmGuestUpdate() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 1180, 619); setLocationRelativeTo(null); setUndecorated(true); contentPane = new JPanel(); contentPane.setForeground(Color.BLACK); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); addWindowListener(this); JLabel lbName = new JLabel("ច្្ម ោះច្្ញៀវ :"); lbName.setForeground(new Color(153, 50, 204)); lbName.setFont(new Font("Khmer OS Muol Light", Font.BOLD, 14)); lbName.setBounds(36, 243, 94, 29); contentPane.add(lbName); JLabel lbTitle = new JLabel("ងារ :"); lbTitle.setForeground(new Color(153, 50, 204)); lbTitle.setFont(new Font("Khmer OS Muol Light", Font.BOLD, 14)); lbTitle.setBounds(36, 285, 94, 29); contentPane.add(lbTitle); lbAddress = new JLabel("អាស័យោា ន :"); lbAddress.setForeground(new Color(153, 50, 204)); lbAddress.setFont(new Font("Khmer OS Muol Light", Font.BOLD, 14)); lbAddress.setBounds(36, 326, 94, 29); contentPane.add(lbAddress);
  • 38. JPanel panel = new JPanel(); panel.setBackground(new Color(224, 255, 255)); panel.setForeground(new Color(127, 255, 212)); panel.setBounds(430, 211, 729, 386); contentPane.add(panel); panel.setLayout(null); model=new DefaultTableModel(); model.addColumn("កូ "); model.addColumn("ច្្ម ោះ"); model.addColumn("ងារ"); model.addColumn("អាស័យោា ន"); model.addColumn("ប្ាក់ច្រៀល"); model.addColumn("ប្ាក់ ា រ"); model.addColumn("កា ូរ"); tbGuest = new JTable(model); tbGuest.getColumnModel().getColumn(0).setMinWidth(0); tbGuest.getColumnModel().getColumn(0).setMaxWidth(0); tbGuest.getColumnModel().getColumn(0).setWidth(0); tbGuest.setRowHeight(25); tbGuest.getTableHeader().setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 18)); tbGuest.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 14)); tbGuest.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { getID=(int) tbGuest.getValueAt(tbGuest.getSelectedRow(), 0); String nm=(String) tbGuest.getValueAt(tbGuest.getSelectedRow(), 1); String ti=(String) tbGuest.getValueAt(tbGuest.getSelectedRow(), 2); String ad=(String) tbGuest.getValueAt(tbGuest.getSelectedRow(), 3); txtName.setText(nm); cboTitle.setText(ti); txtAddress.setText(ad); LbMessage.setText(""); enabledButton(true); } }); int v = ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED; int h = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED; jsp=new JScrollPane(tbGuest,v,h); jsp.setBounds(10, 54, 709, 317); panel.add(jsp); txtSearch = new JTextField(); txtSearch.addKeyListener(new KeyAdapter() {
  • 39. @Override public void keyReleased(KeyEvent e) { try{ int rc= model.getRowCount(); for(int j = 0;j<rc;j++){ model.removeRow(0); } String sql="Select * From tbGuest Where Name Like N'%"+ txtSearch.getText() + "%'"+"Collate Khmer_100_Bin"; try { rs=stmt.executeQuery(sql); while(rs.next()){ int code=rs.getInt(1); String nm=rs.getString(2); String ti=rs.getString(3); String ad=rs.getString(4); Double riels=rs.getDouble(5); Double dollars=rs.getDouble(6); String gift=rs.getString(7); Object[] obj={code,nm,ti,ad,riels,dollars,gift}; model.addRow(obj); } } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } getID=(int) tbGuest.getValueAt(0, 0); String nm=(String) tbGuest.getValueAt(0, 1); String ti=(String) tbGuest.getValueAt(0, 2); String ad=(String) tbGuest.getValueAt(0, 3); txtName.setText(nm); cboTitle.setText(ti); txtAddress.setText(ad); enabledButton(true); LbMessage.setText(""); }catch(Exception exc){} } }); txtSearch.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 14)); txtSearch.setColumns(10); txtSearch.setBounds(354, 11, 226, 32); panel.add(txtSearch); JLabel lbSearch = new JLabel("ស្សែ្រកាមច្្ម ោះ"); lbSearch.setForeground(new Color(255, 0, 255)); lbSearch.setFont(new Font("Khmer OS Fasthand", Font.BOLD, 15)); lbSearch.setBounds(162, 12, 158, 29); panel.add(lbSearch); btnSave = new JButton(""); btnSave.setOpaque(false); btnSave.setContentAreaFilled(false);
  • 40. btnSave.setBorderPainted(false); btnSave.setIcon(new ImageIcon(this.getClass().getResource("/btnsave2.png"))); btnSave.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub String sql=""; LbMessage.setText("សូមច្ប្ជើសច្រើសប្រច្្ទឆំណ្ថ្ ..!"); if(rdRiels.isSelected()){ if(txtRDG.getText().equals("")){ LbMessage.setText("សូមរញ្ជូ លទឹកប្ាក់ច្ៅកន្ប្រអរ់..!"); txtRDG.requestFocus(); }else{ double amount=Double.parseDouble(txtRDG.getText()); sql="Update tbGuest Set Riels="+amount+" Where Code="+ getID; } } else if(rdDollar.isSelected()){ if(txtRDG.getText().equals("")){ LbMessage.setText("សូមរញ្ជូ លទឹកប្ាក់ច្ៅកន្ប្រអរ់..!"); txtRDG.requestFocus(); }else{ double amount=Double.parseDouble(txtRDG.getText()); sql="Update tbGuest Set Dollars="+amount+" Where Code="+ getID; } } else if(rdGift.isSelected()){ if(txtRDG.getText().equals("")){ LbMessage.setText("សូមរញ្ជូ លការ ូច្ៅកន្ប្រអរ់..!"); txtRDG.requestFocus(); }else{ String gift="'"+txtRDG.getText()+"'"; sql="Update tbGuest Set Gift=N"+gift+" Where Code="+ getID; } } int r=0; try { r = stmt.executeUpdate(sql); } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } if(r==1){ LbMessage.setText("អរ់អរសារទ !ច្ កអនកានរញ្ជូ លទិននន័យានច្ោគជ័យ..!");
  • 41. int rc= model.getRowCount(); for(int i = 0;i<rc;i++){ model.removeRow(0); } windowOpened(null); } }@Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub btnSave.setIcon(new ImageIcon(this.getClass().getResource("/btnSave2.png"))); }@Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub btnSave.setIcon(new ImageIcon(this.getClass().getResource("/btnSave3.png"))); } }); btnSave.setBounds(48, 550, 87, 35); contentPane.add(btnSave); btnNew = new JButton(""); btnNew.setOpaque(false); btnNew.setContentAreaFilled(false); btnNew.setBorderPainted(false); btnNew.setIcon(new ImageIcon(this.getClass().getResource("/btnNew.png"))); btnNew.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub clearData(); LbMessage.setText(""); txtName.requestFocus(); enabledButton(true); hideComponent(); bg.clearSelection(); }@Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub btnNew.setIcon(new ImageIcon(this.getClass().getResource("/btnNew.png"))); }@Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub btnNew.setIcon(new ImageIcon(this.getClass().getResource("/btnNew1.png"))); } }); btnNew.setBounds(171, 550, 87, 35); contentPane.add(btnNew); btnClose = new JButton(); btnClose.setOpaque(false); btnClose.setContentAreaFilled(false); btnClose.setBorderPainted(false); btnClose.setIcon(new ImageIcon(this.getClass().getResource("/btnExit2.png"))); btnClose.addMouseListener(new MouseAdapter() { @Override
  • 42. public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub int i=0; i=JOptionPane.showConfirmDialog(null, "Do you want to close?"); if(i==0){ dispose(); } }@Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub btnClose.setIcon(new ImageIcon(this.getClass().getResource("/btnExit2.png"))); }@Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub btnClose.setIcon(new ImageIcon(this.getClass().getResource("/btnExit3.png"))); } }); btnClose.setBounds(296, 550, 94, 35); contentPane.add(btnClose); lbGroom = new JLabel(""); lbGroom.setHorizontalAlignment(SwingConstants.CENTER); lbGroom.setForeground(Color.ORANGE); lbGroom.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 18)); lbGroom.setBounds(397, 135, 126, 29); contentPane.add(lbGroom); lbBride = new JLabel(""); lbBride.setHorizontalAlignment(SwingConstants.CENTER); lbBride.setForeground(Color.ORANGE); lbBride.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 18)); lbBride.setBounds(650, 135, 126, 29); contentPane.add(lbBride); rdDollar = new JRadioButton("ប្ាក់ ា រ"); rdDollar.setBackground(new Color(112, 128, 144)); rdDollar.setForeground(new Color(248, 248, 255)); rdDollar.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { lbShift.setVisible(true); txtRDG.setVisible(true); lbShift.setText("ឆំនួនទឹកប្ាក់"); LbMessage.setText(""); txtRDG.requestFocus(); } }); rdDollar.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 14)); rdDollar.setBounds(159, 394, 120, 51); contentPane.add(rdDollar); rdGift = new JRadioButton("កា ូរ"); rdGift.setBackground(new Color(112, 128, 144)); rdGift.setForeground(new Color(248, 248, 255)); rdGift.addActionListener(new ActionListener() {
  • 43. public void actionPerformed(ActionEvent e) { lbShift.setVisible(true); lbShift.setText("កា ូរ"); txtRDG.setVisible(true); txtRDG.requestFocus(); LbMessage.setText(""); } }); rdGift.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 14)); rdGift.setBounds(289, 394, 79, 51); contentPane.add(rdGift); bg=new ButtonGroup(); bg.add(rdDollar); bg.add(rdGift); lbShift = new JLabel("New label"); lbShift.setForeground(new Color(153, 50, 204)); lbShift.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 14)); lbShift.setBounds(36, 456, 126, 29); contentPane.add(lbShift); txtRDG = new JTextField(); txtRDG.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent arg0) { if(txtRDG.getText()!=""){ LbMessage.setText(""); } } }); txtRDG.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 14)); txtRDG.setColumns(10); txtRDG.setBounds(170, 454, 228, 32); contentPane.add(txtRDG); JPanel panel_1 = new JPanel(); panel_1.setBackground(new Color(112, 128, 144)); panel_1.setBounds(36, 394, 354, 51); contentPane.add(panel_1); panel_1.setLayout(null); rdRiels = new JRadioButton("ប្ាក់ច្រៀល"); rdRiels.setBounds(6, 0, 94, 49); panel_1.add(rdRiels); rdRiels.setBackground(new Color(112, 128, 144)); rdRiels.setForeground(new Color(248, 248, 255)); rdRiels.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { lbShift.setVisible(true); lbShift.setText("ឆំនួនទឹកប្ាក់"); txtRDG.setVisible(true); txtRDG.requestFocus(); LbMessage.setText("");
  • 44. } }); rdRiels.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 14)); bg.add(rdRiels); LbMessage = new JLabel(""); LbMessage.setHorizontalAlignment(SwingConstants.CENTER); LbMessage.setForeground(Color.RED); LbMessage.setFont(new Font("Khmer OS Bokor", Font.PLAIN, 14)); LbMessage.setBounds(36, 497, 362, 29); contentPane.add(LbMessage); txtName = new JLabel(""); txtName.setOpaque(true); txtName.setBackground(new Color(192, 192, 192)); txtName.setForeground(new Color(0, 0, 128)); txtName.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 14)); txtName.setBounds(149, 243, 234, 29); contentPane.add(txtName); cboTitle = new JLabel(""); cboTitle.setOpaque(true); cboTitle.setBackground(new Color(192, 192, 192)); cboTitle.setForeground(new Color(0, 0, 128)); cboTitle.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 14)); cboTitle.setBounds(149, 283, 234, 29); contentPane.add(cboTitle); txtAddress = new JLabel(""); txtAddress.setOpaque(true); txtAddress.setVerticalAlignment(SwingConstants.TOP); txtAddress.setBackground(new Color(192, 192, 192)); txtAddress.setForeground(new Color(0, 0, 128)); txtAddress.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 14)); txtAddress.setBounds(149, 326, 234, 56); contentPane.add(txtAddress); lbPicture = new JLabel(""); lbPicture.setBounds(0, 0, 1179, 619); contentPane.add(lbPicture); lbPicture.setIcon(new ImageIcon(this.getClass().getResource("/BGuest.png"))); lbShift.setVisible(false); txtRDG.setVisible(false); enabledButton(false); setVisible(true); }  Form របាយការែ៏ public frmReport() { setResizable(false); setUndecorated(true);//Remove Title bar setLocationRelativeTo(null); Operators ops=new Operators();
  • 45. //----- Set Form Center Screen-------- int width=996,height=513; Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); int x = (screen.width - width) / 2; int y = (screen.height - height) / 2; setBounds(x, y, width, height); //------------------------------------ contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JButton btnNewButton = new JButton(""); btnNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { dispose(); } }); btnNewButton.setFont(new Font("Tahoma", Font.PLAIN, 10)); btnNewButton.setBounds(963, 0, 34, 30); btnNewButton.setIcon(new ImageIcon(this.getClass().getResource("/close.png"))); btnNewButton.setBackground(null); btnNewButton.setOpaque(false); btnNewButton.setContentAreaFilled(false); btnNewButton.setBorderPainted(false); contentPane.add(btnNewButton); lbGName = new JLabel("Groom Name"); lbGName.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 20)); lbGName.setHorizontalAlignment(SwingConstants.CENTER); lbGName.setBounds(274, 168, 145, 38); contentPane.add(lbGName); LbBName = new JLabel("Bride Name"); LbBName.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 20)); LbBName.setHorizontalAlignment(SwingConstants.CENTER); LbBName.setBounds(536, 168, 180, 38); contentPane.add(LbBName); JLabel label = new JLabel("រាយការណ៏ សររថ្នពិធីម្គលការ"); label.setForeground(new Color(220, 20, 60)); label.setFont(new Font("Khmer OS Bokor", Font.PLAIN, 20)); label.setBounds(329, 238, 243, 38); contentPane.add(label); JPanel panel = new JPanel(); panel.setBackground(new Color(222, 184, 135)); panel.setBounds(95, 276, 801, 181); contentPane.add(panel); panel.setLayout(null); LbTGC = new JLabel(); LbTGC.setForeground(Color.BLUE); LbTGC.setBounds(10, 67, 421, 46); LbTGC.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 20)); panel.add(LbTGC);
  • 46. LbTAG = new JLabel(); LbTAG.setForeground(Color.BLUE); LbTAG.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 20)); LbTAG.setBounds(10, 124, 421, 46); panel.add(LbTAG); LbTR = new JLabel(); LbTR.setForeground(Color.BLUE); LbTR.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 20)); LbTR.setBounds(441, 11, 350, 46); panel.add(LbTR); LbTD = new JLabel(); LbTD.setForeground(Color.BLUE); LbTD.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 20)); LbTD.setBounds(441, 67, 350, 46); panel.add(LbTD); LbTGift = new JLabel(); LbTGift.setForeground(Color.BLUE); LbTGift.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 20)); LbTGift.setBounds(441, 124, 350, 46); panel.add(LbTGift); LbTG = new JLabel(); LbTG.setForeground(Color.BLUE); LbTG.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 20)); LbTG.setBounds(10, 10, 421, 46); panel.add(LbTG); JLabel lblNewLabel = new JLabel(""); lblNewLabel.setBounds(0, 0, 997, 518); lblNewLabel.setIcon(new ImageIcon(this.getClass().getResource("/report2.png"))); contentPane.add(lblNewLabel); ///------- Opened Form----- String sql; ops.SetConnectionSql(); //--------Groom Name and Bride Name---------- sql="select GroomName,BrideName from tbUser"; try { ops.rs=ops.stmt.executeQuery(sql); while(ops.rs.next()){ lbGName.setText(ops.rs.getString(1)); LbBName.setText(ops.rs.getString(2)); } } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } //--------count Money-------------------- sql ="select format(sum(Riels),'0')as R,format(sum(Dollars),'0.00')as D from dbWedding.dbo.tbGuest"; try { ops.rs=ops.stmt.executeQuery(sql); while(ops.rs.next()){
  • 47. LbTR.setText("ទឹកប្ាក់សររោច្រៀល៖ "+ ops.rs.getString(1)+" ច្រៀល"); LbTD.setText("ទឹកប្ាក់សររោ ា ៖ "+ops.rs.getString(2)+" ា "); } //--------count Gift--------------------- sql="select COUNT(Gift)as G from dbWedding.dbo.tbGuest where Gift is not null "; ops.rs=ops.stmt.executeQuery(sql); while(ops.rs.next()){ LbTGift.setText("ឆំនួនការ ូរសររ៖ "+ ops.rs.getString(1)); } //------Count Guest not join------------- sql="select count(*) from dbWedding.dbo.tbGuest where Riels is null and Dollars is null and Gift is null"; ops.rs=ops.stmt.executeQuery(sql); while(ops.rs.next()){ LbTAG.setText("ឆំនូនច្្ញៀវមិនានឆូលរួមសររ៖ "+ops.rs.getString(1) +" នាក់"); } //-------Count Guest join--------------- sql="select count(*) from dbWedding.dbo.tbGuest where Riels is not null or Dollars is not null or Gift is not null"; ops.rs=ops.stmt.executeQuery(sql); while(ops.rs.next()){ LbTGC.setText("ឆំនូនច្្ញៀវឆូលរួមសររ៖ "+ ops.rs.getString(1)+" នាក់"); } //-------count all guest----------------- sql="select count(*) from dbWedding.dbo.tbGuest "; ops.rs=ops.stmt.executeQuery(sql); while(ops.rs.next()){ LbTG.setText("ឆំនូនច្្ញៀវស្ លានច្ៅសររ៖ "+ops.rs.getString(1)+" នាក់"); } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } }  Form អំពីពួកលយើង public frmAbout() { setResizable(false); setUndecorated(true);//Remove Title bar setLocationRelativeTo(null); Operators ops=new Operators(); //----- Set Form Center Screen-------- int width=996,height=513; Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); int x = (screen.width - width) / 2; int y = (screen.height - height) / 2;
  • 48. setBounds(x, y, width, height); //------------------------------------ contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JButton btnNewButton = new JButton(""); btnNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { dispose(); } }); btnNewButton.setFont(new Font("Tahoma", Font.PLAIN, 10)); btnNewButton.setBounds(963, 0, 34, 30); btnNewButton.setIcon(new ImageIcon(this.getClass().getResource("/close.png"))); btnNewButton.setBackground(null); btnNewButton.setOpaque(false); btnNewButton.setContentAreaFilled(false); btnNewButton.setBorderPainted(false); contentPane.add(btnNewButton); JLabel lblNewLabel_1 = new JLabel(""); lblNewLabel_1.setBounds(40, 40, 115, 115); lblNewLabel_1.setIcon(new ImageIcon(this.getClass().getResource("/logo.png"))); contentPane.add(lblNewLabel_1); JPanel panel = new JPanel(); panel.setBackground(new Color(211, 211, 211)); panel.setBounds(367, 98, 564, 369); contentPane.add(panel); panel.setLayout(null); String text = "<html><p>&nbsp;&nbsp;ច្ោយានច្រៀររារ់ច្ៅកន្ឆំនឆខា្ច្លើច្នោះខាោះរួឆមកច្ហើយច្យើ្ច្ ើញថាវា មានការលំាក<br />" + "ឆំច្ពាោះមាច ស់កមមវិធី ូច្ឆនោះច្ោលរំណ្ថ្នកមមវិធីច្នោះគឺជួយកាត់រនថយនូវរញ្ជា ទាំ្អស់ច្នោះាន។<br />" + "កមមវិធីច្នោះអាឆច្ធែើការរូកសររនូវឆំនួនទឹកប្ាក់ឆំណ្ថ្ ររស់ច្្ញៀវអាឆច្ធែើការកត់ប្ានូវច្្ម ោះច្្ញៀវ<br />" + "ទាំ្អស់ស្ លប្តូវអច្ញ្ជ ើញងាយស្សួលស្សែ្រកច្្ម ោះច្្ញៀវោមួយនឹ្ទឹកប្ាក់ឆំណ្ថ្ ររស់ោត់<br />" + "ឬអាឆោអំច្ោយវតថអនសាវរីយ៏ោច្ ើម។កមមវិធីច្នោះអាឆរកាទកនូវ រាល់ទិននន័យ ទាំ្អស់មិន<br />" + "ឲ្យាត់រ្់ឬខូឆខាតច្ ើយ។កមមវិធីច្នោះក៏អាឆសររច្ធែើោរាយការណ៏ នូវទឹកប្ាក់ានផ្ស្ រ។</p></ht ml>"; JLabel label = new JLabel(text); label.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 15)); label.setBounds(10, 176, 554, 182); panel.add(label);
  • 49. JLabel label_3 = new JLabel("ច្ោលរំណ្ថ្នកមមវិធី"); label_3.setForeground(new Color(255, 0, 0)); label_3.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 14)); label_3.setBounds(10, 146, 161, 36); panel.add(label_3); JLabel label_4 = new JLabel("សមាជិកប្កុម"); label_4.setForeground(new Color(255, 0, 0)); label_4.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 14)); label_4.setBounds(10, 58, 100, 36); panel.add(label_4); JLabel label_5 = new JLabel("សាស្ដ្សាដ ចារយ"); label_5.setForeground(new Color(255, 0, 0)); label_5.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 14)); label_5.setBounds(10, 11, 100, 36); panel.add(label_5); JLabel label_6 = new JLabel("ជី គួ្"); label_6.setForeground(new Color(0, 0, 128)); label_6.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 14)); label_6.setBounds(114, 11, 57, 36); panel.add(label_6); JLabel label_7 = new JLabel("សឹ្ សារា៉ាវីត"); label_7.setForeground(new Color(0, 0, 128)); label_7.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 14)); label_7.setBounds(114, 75, 99, 36); panel.add(label_7); JLabel label_8 = new JLabel("មា៉ា ន់ មករា"); label_8.setForeground(new Color(0, 0, 128)); label_8.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 14)); label_8.setBounds(114, 112, 93, 36); panel.add(label_8); JLabel label_9 = new JLabel(" ីម សខ ី"); label_9.setForeground(new Color(0, 0, 128)); label_9.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 14)); label_9.setBounds(270, 75, 93, 36); panel.add(label_9); JLabel label_10 = new JLabel("ស្ទម ឌីោ"); label_10.setForeground(new Color(0, 0, 128)); label_10.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 14)); label_10.setBounds(270, 112, 93, 36); panel.add(label_10);
  • 50. JLabel lblNewLabel_2 = new JLabel("អំពីពួកច្យើ្"); lblNewLabel_2.setHorizontalAlignment(SwingConstants.CENTER); lblNewLabel_2.setForeground(new Color(255, 127, 80)); lblNewLabel_2.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 23)); lblNewLabel_2.setBounds(538, 53, 179, 43); contentPane.add(lblNewLabel_2); JLabel lblVersion = new JLabel("Version: 1.0"); lblVersion.setForeground(new Color(255, 127, 80)); lblVersion.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 16)); lblVersion.setBounds(141, 400, 101, 30); contentPane.add(lblVersion); JLabel label_1 = new JLabel("ឆ្ន ំ២០១៥-២០១៦"); label_1.setForeground(new Color(255, 127, 80)); label_1.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 16)); label_1.setBounds(121, 341, 153, 30); contentPane.add(label_1); JLabel label_2 = new JLabel("កមមវិធីកត់ប្ាឆំណ្ថ្ អាពាហ៏ពិពាហ៏"); label_2.setForeground(new Color(255, 127, 80)); label_2.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 16)); label_2.setBounds(40, 271, 315, 30); contentPane.add(label_2); JLabel label_11 = new JLabel(""); label_11.setBounds(40, 123, 317, 379); label_11.setIcon(new ImageIcon(this.getClass().getResource("/slide.png"))); contentPane.add(label_11); JLabel lblNewLabel = new JLabel(""); lblNewLabel.setBounds(0, 0, 997, 518); lblNewLabel.setIcon(new ImageIcon(this.getClass().getResource("/aboutus.png"))); contentPane.add(lblNewLabel); }  Form ជំនួយ public frmHelp() { setResizable(false); setUndecorated(true);//Remove Title bar setLocationRelativeTo(null); Operators ops=new Operators(); //----- Set Form Center Screen-------- int width=996,height=513; Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); int x = (screen.width - width) / 2; int y = (screen.height - height) / 2; setBounds(x, y, width, height); //------------------------------------ contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
  • 51. setContentPane(contentPane); contentPane.setLayout(null); JButton btnNewButton = new JButton(""); btnNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { dispose(); } }); btnNewButton.setFont(new Font("Tahoma", Font.PLAIN, 10)); btnNewButton.setBounds(963, 0, 34, 30); btnNewButton.setIcon(new ImageIcon(this.getClass().getResource("/close.png"))); btnNewButton.setBackground(null); btnNewButton.setOpaque(false); btnNewButton.setContentAreaFilled(false); btnNewButton.setBorderPainted(false); contentPane.add(btnNewButton); String text = "<html><p>1. ច្ ើមបីច្ប្រើប្ាស់កមមវិធីច្នោះាន អនកច្ប្រើប្ាស់ប្តូវមានគណនីមួយសំរារ់ច្រើកកមមវិធី<br />" + "2. រច្រៀររច្្កើតគណនី៖ ឆឆច្លើរូត្ (រច្្កើតទិននន័យ)=> រំច្ពញព័ត៌មានកូនកំច្ ោះ និ្កូនប្កមំ <br />&#09;,ថ្ថ្ៃច្រៀរអាពាហ៏ពិពាហ៏ ច្ហើយនឹ្ ពាកយសំងាត់ច្ ើមបីឆូលច្ប្រើប្ាស់ាន។ <br />" + "3. ឆំច្ពាោះការឆូលច្ប្រើប្ាស់៖ វាយពាកយសំងាត់ស្ លច្យើ្ានរច្្កើតច្ៅច្ពល រច្្កើតទិននន័យ ។ <br />&#09;ច្រើសិន វាយពាកយសំងាត់ខសឆំនួន ៥ ្ ច្នាោះកមមវិធីប្តូវានរិទ ច្ោយសែ័យ<br />&#09;ប្រវតដ។<br />" + "4. ឆំច្ពាោះគណនី៖ ឆំច្ពាោះគណនីស្ លានរច្្កើតរួឆច្ហើយ ច្យើ្អាឆផ្លា ស់រដូរព័ត៌មានច្ពលច្ប្កាយ <br />&#09;ាន។<br />" + "5. ការកត់ប្ាព័ត៌មានច្្ញៀវ៖ <br />&#09;- កត់ច្្ម ោះច្្ញៀវច្ ើមបីអច្ញ្ជ ើញឆូលរួមកន្កមមវីធីម្គលការ<br />&#09;- កត់ប្ាឆំណ្ថ្ ច្ពលច្្ញៀវឆូលរួមកន្កមមវិធីម្គលការ<br />" + "6. រូកសរររាយការណ៏ ថ្នការឆូលរួមររស់ច្្ញៀវ នឹ្ រូកសររឆំណ្ថ្ ច្ហើយនឹ្កា ូរ។</p></html>"; JLabel label = new JLabel(text); label.setVerticalAlignment(SwingConstants.TOP); label.setBounds(0,11,559,398); contentPane.add(label); label.setFont(new Font("Khmer OS Battambang", Font.PLAIN, 15)); JScrollPane scroller = new JScrollPane(label, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scroller.setBounds(401,82,559,398); contentPane.add(scroller); JLabel label_3 = new JLabel("ជំនួយថ្នការច្ប្រើប្ាស់កមមវិធី"); label_3.setBounds(401, 44, 208, 38); contentPane.add(label_3); label_3.setForeground(new Color(255, 0, 0));
  • 52. label_3.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 14)); JLabel label_1 = new JLabel(""); label_1.setBounds(120, 44, 115, 115); label_1.setIcon(new ImageIcon(this.getClass().getResource("/logo.png"))); contentPane.add(label_1); JLabel label_2 = new JLabel(""); label_2.setIcon(new ImageIcon(this.getClass().getResource("/slide.png"))); label_2.setBounds(40, 117, 320, 363); contentPane.add(label_2); JLabel label_4 = new JLabel("កមមវិធីកត់ប្ាឆំណ្ថ្ អាពាហ៏ពិពាហ៏"); label_4.setForeground(new Color(255, 127, 80)); label_4.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 16)); label_4.setBounds(62, 280, 315, 48); contentPane.add(label_4); JLabel label_5 = new JLabel("ឆ្ន ំ២០១៥-២០១៦"); label_5.setForeground(new Color(255, 127, 80)); label_5.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 16)); label_5.setBounds(143, 358, 153, 38); contentPane.add(label_5); JLabel label_6 = new JLabel("Version: 1.0"); label_6.setForeground(new Color(255, 127, 80)); label_6.setFont(new Font("Khmer OS Muol Light", Font.PLAIN, 16)); label_6.setBounds(163, 415, 101, 38); contentPane.add(label_6); JLabel lblNewLabel = new JLabel(""); lblNewLabel.setBounds(0, 0, 997, 518); lblNewLabel.setIcon(new ImageIcon(this.getClass().getResource("/aboutus.png"))); contentPane.add(lblNewLabel); }
  • 53. ជំពូកទី ៣ សេចកតីេៃនិដ្ឋា ៃេសស្រម្ច ៃិង ម្តិសោបល់ លោយមានការខិតខំ្បឹងផ្្បងលធវើការ្សាវ្ជាវាមរយៈ្បព័នធ Internet រួមទំងមានការបងាា ត់បល្ងៀន លោយយកចិតតទ្យុកោក់ខពេ់ពីលោកសាស្ត្សាត ចារយ ជី គួង នង រួមនេំនឹងការពិភាកាជាមួយេមាជិកលៅកែុង្កុមនង លនេះ លទ្យើបពួកលយើងបានបលងកើតនូវកមមវិធីលនេះល ើងបានលោយលជាគជ័យ។ កមមវិធីលនេះបលងកើតល ើងាមភាសា Java Programming ជាមួយ Interface Swing រួមនេំនឹងរូបភាពលែើមបីទក់ទញនូវចំណាប់អារមមែ៏ របេ់អែកល្បើ្បាេ់។ កមមវិធីលនេះមាននល្បលយជន៏ជាល្ចើនផ្ែលជួយេ្មួលែល់មាេ េ់កមមវិធីលៅកែុងការកត់ល្ម េះលភ្ៀវ កត់ចំែងថ្ែលភ្ៀវ លធវើរបាយការែ៏ េរុបអំពីលភ្ៀវ ចំនួនទ្យឹក្បាក់ចំែងថ្ែ ចំនួនវតថុអនុេាវរីយ៍ ឬ អំលណាយលនេងៗ នងផ្ែរ។ លទេះបីជាយ៉ា ងណាក៏លោយក៏កមមវិធីលនេះលៅផ្តមានគុែវិបតតិនងផ្ែរចំលពាេះអែកល្បើ្បាេ់។ ងវីលបើកមមវិធីលនេះបលងកើតបានលជាគជ័យក៏ពិតផ្មន ផ្តវាក៏លៅមានភាពខវេះចលនល េះណាមួយ ឬ កំ ុេឆ្ាងណាមួយលោយអលចតនជាក់ជាពុំខាន លោយសារផ្ត្កុមលយើងខ្ុំមិនទន់មានបទ្យពិលសាធន៍ល្ចើន រីឯចំលែេះែឹងក៏លៅមានក្មិត ែូលចែេះលយើងខ្ុំេូមលមាត អភ័យលទេទ្យុកជាមុនទំងលៅលលើែំលែើ រការណាមួយលៅកែុង កមមវិធី ក៏ែូចជាការលរៀបលរៀងជាលេៀវលៅលនេះល ើងនងផ្ែរ។