资源简介
这是我参加java大赛的作品,题目是网络连连看,并且凭借作品还获得了三等奖,希望对大家有所帮助
代码片段和文件信息
package enterGame;
import java.net.URL;
import java.util.ResourceBundle;
import com.sun.javafx.sg.PGNode;
import javafx.animation.Keyframe;
import javafx.animation.Timeline;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.Fxml;
import javafx.fxml.Initializable;
import javafx.scene.Group;
import javafx.scene.Lightbase;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.effect.DropShadow;
import javafx.scene.effect.Lighting;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseEvent;
import javafx.scene.paint.Color;
import javafx.scene.paint.CycleMethod;
import javafx.scene.paint.LinearGradient;
import javafx.scene.paint.Stop;
import javafx.scene.shape.Ellipse;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Text;
import javafx.stage.Popup;
import javafx.util.Duration;
public class Controller implements Initializable{
@Fxml
ImageView image1;
@Fxml
ImageView image2;
@Fxml
ImageView image3;
@Fxml
ImageView image4;
@Fxml
ImageView image5;
@Fxml
ImageView image6;
@Fxml
Ellipse circle1 ;
@Fxml
Ellipse circle2;
@Fxml
Ellipse circle3;
@Fxml
Ellipse circle4;
@Fxml
Ellipse circle5;
@Fxml
Ellipse circle6;
@Fxml
Text text;
@Fxml
TextArea area;
@Fxml
TextField field;
@Fxml
Button aButton ;
@Fxml
Label label;
private boolean open1 = false;
private boolean open2 = false;
private boolean open3= false;
private boolean open4= false;
private boolean open5= false;
private boolean open6= false;
public void openImage (boolean [] open){
if(open[0]){
circle1.setStrokeWidth(10);
circle1.setStroke(Color.web(“#0021cc“));
circle1.setFill(Color.web(“#fff966“));
open1 = true;
}
if(open[1]){
circle2.setStrokeWidth(10);
circle2.setStroke(Color.web(“#00cc21“));
circle2.setFill(Color.RED);
open2 = true;
}
if(open[2]){
circle3.setStrokeWidth(10);
circle3.setStroke(Color.web(“#00ff29“));
circle3.setFill(Color.web(“#ff007a“));
open3 = true;
}
if(open[3]){
circle4.setStrokeWidth(10);
circle4.setStroke(Color.web(“#00a3f1“));
circle4.setFill(Color.web(“#fff500“));
open4 = true;
}
if(open[4]){
circle5.setStrokeWidth(10);
circle5.setStroke(Color.web(“#a3cc00“));
circle5.setFill(Color.web(“#ff00b8“));
open5 = true;
}
if(open[5]){
circle6.setStrokeWidth(10);
circle6.setStroke(Color.RED);
circle6.setFill(Color.web(“#d299ff“));
open6 = true;
}
}
//mouseEnter Event
@Fxml
private void handleMouseEnter(MouseEvent e){
if( e.getSource() == image1 && open1 ){
circle1.setEffect(new Lighting());
}
if( e.getSource() == image2 && open2 ){
circle2.setEffect(new Lighting());
}
if(e.getTarget() == image3 && open3 ){
circle3.setEffect(new Lighting());
}
if(e.getSou
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-07-12 12:08 gameroom\
文件 133573 2013-05-09 11:54 gameroom\a.jpg
目录 0 2013-07-12 12:08 gameroom\enterGame\
文件 70 2013-05-09 19:03 gameroom\enterGame\a.css
文件 6024 2013-05-10 22:53 gameroom\enterGame\Controller.java
文件 8113 2013-05-10 22:16 gameroom\enterGame\gameroom.fxm
文件 601 2013-05-09 18:43 gameroom\enterGame\Main.java
文件 9912 2013-05-09 12:50 gameroom\head1.gif
文件 9240 2013-05-09 12:50 gameroom\head2.gif
文件 10712 2013-05-09 12:50 gameroom\head3.gif
文件 10622 2013-05-09 12:50 gameroom\head4.gif
文件 8412 2013-05-09 12:50 gameroom\head5.gif
文件 9946 2013-05-09 12:50 gameroom\head6.gif
- 上一篇:java程序 书店管理系统
- 下一篇:java-loadresource.rar
评论
共有 条评论