The first day of Java programming--"guess" game

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.