12-03-2014, 05:28 PM
[B]
CS506 Web Design and Development Assignment No. 02(GRADED) Solution and Discussion 2014 Due Date 10th December 2014
You have to upload only a source code file with (.java) extension. Assignment in any other format (extension) will not be accepted and will be awarded with zero marks. For example, if you submit code in .doc (Word document) or .txt files or .exe file, no reward will be given in any case.
Note: Use Notepad or Notepad++ , or NetBeans for coding and JDK package for java source code compilation and running (A video tutorial of JDK installation and configuration is given in course download section)
Objective
The objective of this assignment is
To understanding of User Graphical Interface, layout mangers, frames and Event Handling concepts in java programs.
Problem Statement:
You are required to write a java program which handles the “MouseEvent” by implementing “MouseListener” interface.
Detailed Description:
Develop a GUI component and set the layout using “FlowLayout” manger. The program should have two text fields used for displaying your name and VUID as a default text. There should also be two labels in your GUI. Following four controls should be used in your GUI application.
Student Name (JLabel)
VU ID(JLabel)
Student_Name (JTextField)
VU_ID (JTextField)
Following is the behavior of your GUI Application which handles the Mouse Events program.
When mouse enter the boundary of frame window “default text should be appeared” in the respective textfields i.e. your name and VUID
When mouse exit the boundary of frame window “default text should be removed” from the text fields, it sets empty.
For this your class has to implement the MouseListener interface, MouseListener interface has following five abstract methods.
public interface MouseListener {
public void mousePressed (MouseEvent me);
public void mouseClicked (MouseEvent me);
public void mouseReleased (MouseEvent me);
public void mouseEntered (MouseEvent me);
public void mouseExited (MouseEvent me);
}
But your class will implement the logic in last two methods,
public void mouseEntered (MouseEvent me);
You will write the logic in above method when mouse enter the frame window i.e. setting of text in respective text fields
public void mouseExited (MouseEvent me);
You will write the logic in above method when mouse leaves the frame window i.e. clearing of text in respective text fields
Remaining methods will have an empty body.
Set the frame size “width 300 and height 200”.
You can use the setText(String) method for setting of text of Two JTextField. Use your name and your VUID to store values in these two text fields
When you exit from the program, it should close the frame.
Sample Output:
Mouse enter the boundary of frame window
Mouse exit the boundary of frame window
[/B]
CS506 Web Design and Development Assignment No. 02(GRADED) Solution and Discussion 2014 Due Date 10th December 2014
You have to upload only a source code file with (.java) extension. Assignment in any other format (extension) will not be accepted and will be awarded with zero marks. For example, if you submit code in .doc (Word document) or .txt files or .exe file, no reward will be given in any case.
Note: Use Notepad or Notepad++ , or NetBeans for coding and JDK package for java source code compilation and running (A video tutorial of JDK installation and configuration is given in course download section)
Objective
The objective of this assignment is
To understanding of User Graphical Interface, layout mangers, frames and Event Handling concepts in java programs.
Problem Statement:
You are required to write a java program which handles the “MouseEvent” by implementing “MouseListener” interface.
Detailed Description:
Develop a GUI component and set the layout using “FlowLayout” manger. The program should have two text fields used for displaying your name and VUID as a default text. There should also be two labels in your GUI. Following four controls should be used in your GUI application.
Student Name (JLabel)
VU ID(JLabel)
Student_Name (JTextField)
VU_ID (JTextField)
Following is the behavior of your GUI Application which handles the Mouse Events program.
When mouse enter the boundary of frame window “default text should be appeared” in the respective textfields i.e. your name and VUID
When mouse exit the boundary of frame window “default text should be removed” from the text fields, it sets empty.
For this your class has to implement the MouseListener interface, MouseListener interface has following five abstract methods.
public interface MouseListener {
public void mousePressed (MouseEvent me);
public void mouseClicked (MouseEvent me);
public void mouseReleased (MouseEvent me);
public void mouseEntered (MouseEvent me);
public void mouseExited (MouseEvent me);
}
But your class will implement the logic in last two methods,
public void mouseEntered (MouseEvent me);
You will write the logic in above method when mouse enter the frame window i.e. setting of text in respective text fields
public void mouseExited (MouseEvent me);
You will write the logic in above method when mouse leaves the frame window i.e. clearing of text in respective text fields
Remaining methods will have an empty body.
Set the frame size “width 300 and height 200”.
You can use the setText(String) method for setting of text of Two JTextField. Use your name and your VUID to store values in these two text fields
When you exit from the program, it should close the frame.
Sample Output:
Mouse enter the boundary of frame window
Mouse exit the boundary of frame window
[/B]
0300-9520262
Get solution in 24 hour |cpmputer & internet
mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
