Course training is to do a guessing game. It's really hard for me to be unfamiliar with the code. But I'm going to work on it.
Import Java.awt.eventqueue;import Javax.swing.jframe;import Javax.swing.jpanel;import Javax.swing.border.emptyborder;import Javax.swing.jbutton;import Javax.swing.jtextfield;import Javax.swing.JLabel ; Import Java.awt.color;import Java.awt.systemcolor;import Java.awt.event.actionlistener;import Java.awt.event.actionevent;import Java.awt.event.mouseadapter;import java.awt.event.MouseEvent;
Guess which Java package to use has these.
The first day of the training I was thinking how to do a guess to run the game, according to the teacher to modify the code, and to go to Baidu to find relevant information, and strive to complete the guessing game code.
This is the whole page.
Picture has not been able to display the corresponding, in the effort.
Related code that shows the hint of text
Set Reminder text JLabel J1 = new JLabel ("Guess Who I am, please click my Photo"); J1.setbounds (5, +, +); This.add (J1); Label, display with guessed student name final JLabel lbguessname = new JLabel ("Student name"); Lbguessname.setbounds (259, he, N.); Contentpane.add (lbguessname); Label, showing first student photo final JLabel lblImg1 = new JLabel ("Student One"); Lblimg1.addmouselistener (New Mouseadapter () {
Others are working hard to achieve.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
The first day of Java programming--"guess" game