資源簡介
自己的大作業,用的是圖的算法,需要的可以參考,有問題可以留言~

代碼片段和文件信息
package?frames;
import?java.awt.FlowLayout;
import?java.awt.event.ActionEvent;
import?java.awt.event.ActionListener;
import?javax.swing.ImageIcon;
import?javax.swing.JButton;
import?javax.swing.Jframe;
import?javax.swing.JLabel;
import?javax.swing.JPanel;
import?javax.swing.JScrollPane;
import?javax.swing.JTextArea;
import?javax.swing.JTextField;
public?class?Conditionframe?extends?Jframe?implements?ActionListener{
JLabel?label=new?JLabel();
JButton?btn1btn2btn3btn4btn5;
JPanel?pl1;
JTextArea?route;
String?string=““;
public?Conditionframe()?{
ImageIcon?icon?=?new?ImageIcon(“src/image/3.jpg“);
label.setIcon(icon);
label.setBounds(00?600?400);
add(label);
btn1=new?JButton(“人行道道路“);
btn2=new?JButton(“車行道道路“);
btn3=new?JButton(“一級風景區“);
btn4=new?JButton(“二級風景區“);
btn5=new?JButton(“三級風景區“);
route=new?JTextArea(550);
pl1=new?JPanel(new?FlowLayout(FlowLayout.CENTER1020));
pl1.add(btn1);
pl1.add(btn2);
pl1.add(btn3);
pl1.add(btn4);
pl1.add(btn5);
pl1.add(new?JScrollPane(route));
pl1.setBounds(0?400?600?400);
add(pl1);
btn1.addActionListener(this);
btn2.addActionListener(this);
btn3.addActionListener(this);
btn4.addActionListener(this);
btn5.addActionListener(this);
setBounds(600300600630);
setLayout(null);
settitle(“校園全景圖“);
setVisible(false);
validate();
}
@Override
public?void?actionPerformed(ActionEvent?e)?{
if?(e.getSource()==btn1)?{
string=““;
for(int?i=0;i<20;i++){
if(Util.list1.get(i).getType()==“人行道“){
string+=Util.list1.get(i).getName().toString()+“??“;
}
}
route.setText(string);
}
if?(e.getSource()==btn2)?{
string=““;
for(int?i=0;i<20;i++){
if(Util.list1.get(i).getType()==“車行道“){
string+=Util.list1.get(i).getName().toString()+“??“;
}
}
route.setText(string);
}
if?(e.getSource()==btn3)?{
string=““;
for(int?i=0;i<20;i++){
if(Util.list1.get(i).getLevel()==“一級風景區“){
string+=Util.list1.get(i).getName().toString()+“??“;
}
}
route.setText(string);
}
if?(e.getSource()==btn4)?{
string=““;
for(int?i=0;i<20;i++){
if(Util.list1.get(i).getLevel()==“二級風景區“){
string+=Util.list1.get(i).getName().toString()+“??“;
}
}
route.setText(string);
}
if?(e.getSource()==btn5)?{
string=““;
for(int?i=0;i<20;i++){
if(Util.list1.get(i).getLevel()==“三級風景區“){
string+=Util.list1.get(i).getName().toString()+“??“;
}
}
route.setText(string);
}
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2016-09-15?23:37??校園咨詢\
?????文件?????????301??2016-09-15?23:35??校園咨詢\.classpath
?????文件?????????388??2016-09-15?23:35??校園咨詢\.project
?????目錄???????????0??2016-09-15?23:37??校園咨詢\.settings\
?????文件?????????598??2016-09-15?23:35??校園咨詢\.settings\org.eclipse.jdt.core.prefs
?????目錄???????????0??2016-09-15?23:37??校園咨詢\bin\
?????目錄???????????0??2016-09-15?23:37??校園咨詢\bin\fr
?????文件????????3509??2016-09-15?23:36??校園咨詢\bin\fr
?????文件????????4880??2016-09-15?23:36??校園咨詢\bin\fr
?????文件????????5675??2016-09-15?23:36??校園咨詢\bin\fr
?????文件?????????936??2016-09-15?23:36??校園咨詢\bin\fr
?????文件????????3076??2016-09-15?23:36??校園咨詢\bin\fr
?????文件?????????802??2016-09-15?23:36??校園咨詢\bin\fr
?????文件????????2477??2016-09-15?23:36??校園咨詢\bin\fr
?????文件?????????421??2016-09-15?23:36??校園咨詢\bin\fr
?????目錄???????????0??2016-09-15?23:37??校園咨詢\bin\Graph\
?????文件????????3203??2016-09-15?23:36??校園咨詢\bin\Graph\AbstractGraph.class
?????文件????????2053??2016-09-15?23:36??校園咨詢\bin\Graph\Matrix.class
?????文件????????2972??2016-09-15?23:36??校園咨詢\bin\Graph\MatrixGraph.class
?????文件?????????821??2016-09-15?23:36??校園咨詢\bin\Graph\Node.class
?????文件????????2670??2016-09-15?23:36??校園咨詢\bin\Graph\SeqList.class
?????文件????????2520??2016-09-15?23:36??校園咨詢\bin\Graph\SinglyList.class
?????文件?????????857??2016-09-15?23:36??校園咨詢\bin\Graph\Triple.class
?????目錄???????????0??2016-09-15?23:37??校園咨詢\bin\image\
?????文件???????85880??2016-09-15?23:36??校園咨詢\bin\image\1.jpg
?????文件????????8970??2016-09-15?23:36??校園咨詢\bin\image\2.jpg
?????文件???????12038??2016-09-15?23:36??校園咨詢\bin\image\3.jpg
?????目錄???????????0??2016-09-15?23:37??校園咨詢\src\
?????目錄???????????0??2016-09-15?23:37??校園咨詢\src\fr
?????文件????????2661??2016-09-15?23:36??校園咨詢\src\fr
?????文件????????5434??2016-09-15?23:36??校園咨詢\src\fr
............此處省略17個文件信息
評論
共有 條評論