This document describes a Java programming assignment on a wedding planning application. The project aims to address issues with existing wedding planning tools by developing a program that allows users to manage guest lists, update guest money contributions, view reports and more. The program is intended to help organizers reduce errors and save time in planning events. The document outlines the objectives, scope, limitations and expected sections of the program including analysis, design, implementation and figures.
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. ឯការសោង
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
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));
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;