import javax.swing.*;
import javax.imageio.ImageIO;
import java.awt.Graphics;
import java.io.*;
import java.awt.Image;
import java.awt.*;
public class MyClass {
public static void main(String[] args)throws Exception {
new Extra();
}
}
class Extra extends JFrame
{
JMenuBar mb;
JMenu File,View,Settings,Audio,Video,Help;
JMenuItem OpenFile,OpenDirectory,OpenDisc,Exit,PlayList, Messages,SwitchInterface,AddInterface,Bookmarks,Pr eferences,About;
MyPanel mp;
Extra()
{
super("JKS Player");
setLayout(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mb=new JMenuBar();
File=new JMenu("File");
View=new JMenu("View");
Settings=new JMenu("Settings");
Audio=new JMenu("Audio");
Video=new JMenu("Video");
Help=new JMenu("Help");
OpenFile=new JMenuItem("Open File");
OpenDirectory=new JMenuItem("Open Directory");
OpenDisc=new JMenuItem("Open Disc");
Exit=new JMenuItem("Exit");
PlayList=new JMenuItem("PlayList");
Messages=new JMenuItem("Messages");
SwitchInterface=new JMenuItem("Switch Interface");
AddInterface=new JMenuItem("Add Interface");
Bookmarks=new JMenuItem("Bookmarks");
Preferences=new JMenuItem("Preferences");
About=new JMenuItem("About");
mb.add(File);
mb.add(View);
mb.add(Settings);
mb.add(Help);
File.setBounds(0, 0, 5,2 );
View.setBounds(5, 0, 5,2);
Settings.setBounds(10,0,5,2);
Help.setBounds(15, 0, 5, 2);
File.add(OpenFile);
File.add(OpenDirectory);
File.add(OpenDisc);
File.add(Exit);
View.add(PlayList);
View.add(Messages);
Settings.add(SwitchInterface);
Settings.add(AddInterface);
Settings.add(Bookmarks);
Settings.add(Preferences);
Help.add(About);
mp=new MyPanel();
add(mp);
pack();
setVisible(true);
mb.setVisible(true);
mp.setVisible(true);
setSize(600,600);
setJMenuBar(mb);
}
class MyPanel extends JPanel
{
public void Paint(Graphics g)
{
try{
Image img=ImageIO.read(new File("C:\\Users\\Mehta\\Desktop\\images\\Capture a.jpg"));
g.drawImage(img,5,2,this);
}catch(Exception e){ };
}
}
}