📄 salatenglish.java
字号:
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.io.*;
import javazoom.jl.player.jlp;
import javazoom.jl.player.*;
import javazoom.jl.player.Player;
import javazoom.jl.player.advanced.jlap;
import javazoom.jl.player.advanced.AdvancedPlayer;
import javazoom.jl.player.advanced.*;
import javazoom.jl.player.advanced.PlaybackListener;
import javazoom.jl.player.advanced.PlaybackEvent;
import java.applet.*;
import java.text.NumberFormat;
import java.sql.*;
public class SalatEnglish extends JFrame {
static JFrame JFrame = new JFrame("Multimedia");
int mySearch ;
int check=0;
JPanel panel1,panel2 ,panel3;
JMenuBar mainBar;
JMenu fileMenu, aboutMenu;
JMenuItem exitMenuItem, authorMenuItem;
KJPlaybackListener p= new KJPlaybackListener();
AdvancedPlayer a;
AudioClip sound;
jlap soundm = new jlap();
int i=0;
public JTabbedPane tabbedPane = new JTabbedPane();
public SalatEnglish() {
initComponents ();
}
public void initComponents() {
JPanel panel=new JPanel();
////////////////////////////////////////////////////
mainBar = new JMenuBar();
mainBar .setBackground(new java.awt.Color (180,180, 120));
mainBar. setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
setJMenuBar(mainBar);
/*----------------------------------------------------------------------------*/
fileMenu = new JMenu("File");
fileMenu .setBackground(new java.awt.Color (180,180, 120));
fileMenu.setMnemonic('F');
fileMenu . setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
exitMenuItem = new JMenuItem("Exit");
exitMenuItem .setBackground(new java.awt.Color (180,180, 120));
exitMenuItem.addActionListener(new MenuButtonListener());
fileMenu.add(exitMenuItem);
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
aboutMenu = new JMenu("About");
aboutMenu .setBackground(new java.awt.Color (180,180, 120));
aboutMenu . setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
aboutMenu.setMnemonic('A');
authorMenuItem = new JMenuItem("Author");
authorMenuItem .setBackground(new java.awt.Color (180,180, 120));
authorMenuItem.addActionListener(new MenuButtonListener());
aboutMenu.add(authorMenuItem);
/*----------------------------------------------------------------------------*/
mainBar.add(fileMenu);
mainBar.add(aboutMenu);
panel.setLayout(null);
panel.setBackground(new java.awt.Color (180,180, 150));
setTitle("AL SALAH ver 1.0");
//panel.setLayout (new BorderLayout());
panel.setBackground(new java.awt.Color(0,0,0));
tabbedPane. setBackground(new java.awt.Color(240,240,200));
//for (int i=0;i<tabs.length;i++)
//tabbedPane.addTab (tabs[i], createPane (tabs[i]));
tabbedPane.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
tabbedPane.addTab ("Prayer Time ",new ImageIcon("images/prayer.gif"),new namaz());
tabbedPane.addTab ("Qibla ",new ImageIcon("images/kibla.gif"),new qibla());
tabbedPane.addTab ("World Time",new ImageIcon("images/clock.gif"),new Clocktimezone());
tabbedPane.addTab ("Multimedia",new ImageIcon("images/about.gif"),new Multimedia());
tabbedPane.addTab ("Calender",new ImageIcon("images/Calendar.gif"), new Calenderp());
tabbedPane.addTab ("Setting ",new ImageIcon("images/setting.gif"),new setting());
tabbedPane.setForeground(java.awt.Color.black);
tabbedPane.setSelectedIndex(0);
tabbedPane.setBounds(0,0, 800, 570);
panel.add (tabbedPane);
getContentPane().add(panel);
setVisible(true);
setSize(800,570);
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
// new Searchbyreg();
//
}
});
}
public static void main (String args[]) {
//int i=7;
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new SalatEnglish().setVisible(true);
}
});
}
protected void addButtons(JToolBar toolBar) {
JButton button = null;
//first button
button = new JButton(new ImageIcon("images1/left.gif"));
button.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
button.setToolTipText("This is the left button");
button.setBounds(50, 0, 650, 100);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// displayResult("Action for first button");
}
});
toolBar.add(button);
//second button
button = new JButton(new ImageIcon("images1/middle.gif"));
button.setToolTipText("This is the middle button");
button.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
button.setBounds(0, 0, 650, 40);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// displayResult("Action for second button");
new SalatEnglish();
}
});
toolBar.add(button);
//third button
button = new JButton(new ImageIcon("images1/right.gif"));
button.setToolTipText("This is the right button");
//button.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
button.setBounds(0, 0, 650, 40);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
//displayResult("Action for third button");
}
});
toolBar.add(button);
}
public class MenuButtonListener implements ActionListener
{
public void actionPerformed(ActionEvent event)
{
if(event.getSource() == exitMenuItem)
{
System.exit(0);
}
if(event.getSource() == authorMenuItem)
{
Dialogabout d=new Dialogabout(JFrame,"About");
d.setVisible(true);
}
}
}
/**************************************************************************************************/
/////////////////////DILAOG About//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////
public class Dialogabout extends Dialog implements ActionListener {
JLabel jLabelcity= new JLabel();
JLabel jLabeltit1= new JLabel();
JLabel jLabeltit2= new JLabel();
JLabel jLabeltit3= new JLabel();
JLabel jLabeltit4= new JLabel();
JLabel jLabeltit5= new JLabel();
JButton ok=new JButton("OK");
public Dialogabout(Frame frame1,String title) {
super(frame1,title,false);
//frame1.setlayout(null);
setBounds(200,250,500, 300);
String[] cityn = {
"How to do Namaz ?"};
setBackground(new java.awt.Color (180,180, 150));
//combomon.addItem(String.valueOf(monthc[month-1]));
setLayout(null);
jLabeltit1.setFont(new java.awt.Font ("Arial Black",0,25));
jLabeltit1.setText("AL SALAH ver 1.0");
jLabeltit1.setForeground( new java.awt.Color (10,80, 20));
jLabeltit1.setBounds(120, 50, 250, 40);
add(jLabeltit1);
jLabeltit2.setFont(new java.awt.Font ("Arial Black",1,18));
jLabeltit2.setText("By");
jLabeltit2.setForeground( new java.awt.Color(10,80, 20));
jLabeltit2.setBounds(200, 90, 220, 40);
add(jLabeltit2);
jLabeltit3.setFont(new java.awt.Font ("Arial Black",0,20));
jLabeltit3.setText("Usman Ali (BSCS)");
jLabeltit3.setForeground( new java.awt.Color(10,80, 20));
jLabeltit3.setBounds(140, 130, 200, 40);
add(jLabeltit3);
jLabeltit4.setFont(new java.awt.Font ("Arial Black",0,18));
jLabeltit4.setText("usman1266@yahoo.com");
jLabeltit4.setForeground( new java.awt.Color (10,80, 20));
jLabeltit4.setBounds(115, 170, 250, 40);
add(jLabeltit4);
jLabeltit5.setFont(new java.awt.Font ("Arial Black",0,18));
jLabeltit5.setText("0304-9558625");
jLabeltit5.setForeground( new java.awt.Color(10,80, 20));
jLabeltit5.setBounds(150, 190, 250, 40);
add(jLabeltit5);
ok.setFont(new java.awt.Font ("Arial Black",0,12));
ok.setBounds(200,230,80, 35);
ok.setForeground(new java.awt.Color (0,0,0));
ok.setBackground(new java.awt.Color (240,240,200));
ok.addActionListener(this);
add(ok);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
dispose();
}
});
}
/////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
public void actionPerformed(ActionEvent e)
{
JButton button= (JButton)e.getSource();
if(button.equals(ok))
{
dispose();
}
}
}
//////////////////////////////////////////////
/////////////////////////////////////////////////////
/**************************************************************************************************/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -