hmimedmikrob3
Mecha Builder
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1
400 XP
This is a continuation of Login Tutorial and Connecting to MS Access database using JCreator see here With this, I am showing you some twist that after a correct login in the program it will show another form in Java.
1. First create a java program with a filename of MainMenu.java.
2. Import the following libraries.
3. Initialize the following variables below.
4. Create a constructor named MainMenu.
5. Create a method setMain. Instead of using the Main args, we will just use this method and will call from the Login.java.
6. In your Login.java in this this previous link see here. Add the code below.
MainMenu menu = new MainMenu() and menu.setMain() was called when the button with a correct login is clicked and it will show the MainForm.
For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below.
Best Regards,
Engr. Lyndon Bermoy
IT Instructor/System Developer/Android Developer/Freelance Programmer
Mobile: 09488225971
Landline: 826-9296
E-mail:[email protected]
Add and Follow me on Facebook: https://www.facebook.com/donzzsky
Visit and like my page on Facebook at: https://www.facebook.com/BermzISware
Visit and like my page on Facebook at: https://www.facebook.com/BermzISware
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.
Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE:
1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
Download
1. First create a java program with a filename of MainMenu.java.
2. Import the following libraries.
- import
javax.swing.*
;
- import
java.awt.*
;
- import
java.awt.event.*
;
- import
java.io.*
;
3. Initialize the following variables below.
- JDesktopPane
desktop =
new
JDesktopPane
(
)
;;
- String
TITLE =
"This is another form"
;
- JMenuBar
menubar =
new
JMenuBar
(
)
;
- JPanel
panel_Bottom =
new
JPanel
(
)
;
- JPanel
panel_Top =
new
JPanel
(
)
;
4. Create a constructor named MainMenu.
- public
MainMenu(
)
{
- super
(
"This is another form"
)
;
- desktop.setBackground
(
Color
.black
)
;
- panel_Top.setLayout
(
new
BorderLayout
(
)
)
;
- panel_Top.setPreferredSize
(
new
Dimension
(
10
,150
)
)
;
- getContentPane(
)
.add
(
panel_Top,BorderLayout
.PAGE_START
)
;
- getContentPane(
)
.add
(
desktop,BorderLayout
.CENTER
)
;
- getContentPane(
)
.add
(
panel_Bottom,BorderLayout
.PAGE_END
)
;
- }
;
5. Create a method setMain. Instead of using the Main args, we will just use this method and will call from the Login.java.
- public
void
setMain(
)
{
- MainMenu p1=
new
MainMenu(
)
;
- p1.setSize
(
1275
,950
)
;
- p1.setLocation
(
2
,2
)
;
- p1.setVisible
(
true
)
;
- p1.setResizable
(
false
)
;
- }
6. In your Login.java in this this previous link see here. Add the code below.
- if
(
(
loginname.equalsIgnoreCase
(
txtuser.getText
(
)
)
)
&&
(
loginpass.equalsIgnoreCase
(
txtpass.getText
(
)
)
)
)
- {
- MainMenu menu =
new
MainMenu(
)
;
- menu.setMain
(
)
;
- dialogmessage =
"Welcome - "
+
loginname;
- dialogtype =
JOptionPane
.INFORMATION_MESSAGE
;
- JOptionPane
.showMessageDialog
(
(
Component
)
null
, dialogmessage, dialogs, dialogtype)
;
- txtuser.setText
(
""
)
;
- txtpass.setText
(
""
)
;
- dispose(
)
;
- }
MainMenu menu = new MainMenu() and menu.setMain() was called when the button with a correct login is clicked and it will show the MainForm.
For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below.
Best Regards,
Engr. Lyndon Bermoy
IT Instructor/System Developer/Android Developer/Freelance Programmer
Mobile: 09488225971
Landline: 826-9296
E-mail:[email protected]
Add and Follow me on Facebook: https://www.facebook.com/donzzsky
Visit and like my page on Facebook at: https://www.facebook.com/BermzISware
Visit and like my page on Facebook at: https://www.facebook.com/BermzISware
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.
Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE:
1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
Download
You must upgrade your account or reply in the thread to view hidden text.