i wanna show my friend the java i made ![:)]()
thanks to the help of the good guys here![:)]()
i have a site and i can edit its html.
some said i can use this code:
But i don't know how to make a .js file![:(]()
here is my code , it has no errors![:)]()
ill attach a ZIP file also
thanks to the help of the good guys here
i have a site and i can edit its html.
some said i can use this code:
Quote
<!DOCTYPE html>
<html>
<body>
<script src="/Java.js"></script>
</body>
</html>
<html>
<body>
<script src="/Java.js"></script>
</body>
</html>
But i don't know how to make a .js file
here is my code , it has no errors
package simplemenu;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
/**
*
* @author Kelvin Kim A. Soroño BSCPE-2
*/
public class SimpleMenu extends JFrame
{
public static void main(String[] args) {
//VARIABLES
JPanel jp,jp2,jpTITLE,jpGRID,jpGRID2;
final JLabel jl,jlTITLE;
JFrame jf;
JButton jb,jb2,jb3;
//VARIABLES
//THE FRAME
jf = new JFrame("Simple Fastfood Menu by KimKELVIN [www.facebook.com/ilovesandii08] ");
jf.setSize(500,160); //<---------- FRAME SIZE
jf.setVisible(true); //<---------- VISIBILITY
jf.setResizable(false); //<------- RESIZE ON/OFF
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//THE FRAME
//PANELS AND GRID SET UP
jp = new JPanel();
jp2 = new JPanel();
jpTITLE = new JPanel();
jpGRID = new JPanel();
jpGRID2 = new JPanel();
//GRID SET UP
jpGRID.setLayout(new GridLayout(1,3));
jpGRID2.setLayout(new GridLayout(1,1));
//GRID SET UP
//PANELS AND GRID SET UP
//ADD PANELS TO FRAME
jf.add(jpTITLE, BorderLayout.PAGE_START);
jf.add(jp2, BorderLayout.PAGE_END);
jf.add(jp); //<------------------- Adding jp to JFrame
jp2.add(jpGRID); //<-------------- Adding jpGRID to jp2
jp.add(jpGRID2); //<-------------- Adding jpGRID2 to jp
//ADD PANELS TO FRAME
//LABELS
jlTITLE = new JLabel("COMP220 FASTFOOD"); //HEADER
jlTITLE.setFont(new Font("Serif",Font.BOLD,45));
jlTITLE.setForeground(Color.blue);
jpTITLE.add(jlTITLE); //<----- Adding jlTITLE to jpTITLE
jl = new JLabel("Please select your order");
jl.setFont(new Font("Serif",Font.PLAIN,18));
jl.setForeground(Color.red);
jpGRID2.add(jl); //<---------- Adding jl to jpGRID2
//LABELS
//BUTTON LIST
//BUTTON 1 START
jb = new JButton("Hamburger P25.00");
jpGRID.add(jb); //<--------------- Adding JButton to JPanel2
//JBUTTON ACTION
jb.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
jl.setText(" You Have Purchased Hamburger for P25.00 ");
}
});
//JBUTTON ACTION
//BUTTON 1 END
//BUTTON2 START
jb2 = new JButton("Spaghetti P30.00");
jpGRID.add(jb2); //<-------------- Adding JButton2 To JPanel3
//JBUTTON2 ACTION
jb2.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
jl.setText(" You Have Purchased Spaghetti for P30.00 ");
}
});
//JBUTTON2 ACTION
//BUTTON2 END
//BUTTON3 START
jb3 = new JButton("French Fries P35.00");
jpGRID.add(jb3); //<-------------- Adding JButton3 To JPanel4
//JBUTTON2 ACTION START
jb3.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
jl.setText(" You Have Purchased French Fries for P35.00 ");
}
});
//JBUTTON 2 ACTION END
//BUTTON3 END
//ENED OF BUTTON LIST
}
}
ill attach a ZIP file also