-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSort Funcitons
104 lines (72 loc) · 2.18 KB
/
Sort Funcitons
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import javax.swing.ImageIcon;
import javax.swing.JApplet;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.helpers.DefaultHandler;
import javax.swing.*;
public class Search extends JFrame implements ActionListener
{
public JLabel zipLabel;
public JTextField zipField, resultField;
public JButton btnSearch, btnExit;
public Search()
{
setLayout(null);
setSize(600,900);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
zipLabel = new JLabel("Please Enter Your Zip Code:");
zipLabel.setBounds(100,0,200,200);
add(zipLabel);
zipField = new JTextField(10);
zipField.setBounds(100,120,200,25);
zipField.addActionListener(this);
add(zipField);
btnSearch = new JButton ("Search!");
btnSearch.setBounds(100,200,100,100);
btnSearch.addActionListener(this);
add(btnSearch);
btnExit = new JButton("Main Menu ");
btnExit.setBounds(400,400,100,100);
btnExit.addActionListener(this);
add(btnExit);
ImageIcon imageIcon = new ImageIcon("img/image1.jpg");
Image image = imageIcon.getImage();
}
public void actionPerformed(ActionEvent e)
{
if (e.getSource() == btnSearch)
{
int zipValue;
zipValue = Integer.parseInt(zipField.getText());
System.out.println("Searching");
//String name = p.pickFood();
//e.drawImage(image, 0,0, this);
// and then the output go here.........
}
if (e.getSource() == btnExit)
{
userInterface i = new userInterface();
i.setVisible(true);
}
}
public static String pickFood()
{
String foodName= " ";
String [] foodList = {"Pasta","Pizza",""};
int pickNum = (int) (Math.random()*10+1);
return foodName;
}
}