📄 salat.java
字号:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class salat extends JPanel implements ActionListener{
JScrollPane scrollPanewozo,scrollPanegosal,scrollPanenamaz,
scrollPanetaharat,scrollPanefaraz,scrollPanewajeb,
scrollPanemakro,scrollPanemufsa,scrollPanemusthabhat,
scrollPanerakat;
JButton butgosal= new JButton();
JButton butwozo= new JButton();
JButton butnamaz= new JButton();
JButton buttaharat= new JButton();
JButton butfaraz= new JButton();
JButton butwajebat= new JButton();
JButton butmakro= new JButton();
JButton butmufsadat= new JButton();
JButton butmusthabat= new JButton();
JButton butrakat= new JButton();
JLabel title=new JLabel();
JLabel gosal= new JLabel(new ImageIcon("images/GOSAL.GIF"));
JLabel wozo = new JLabel(new ImageIcon("images/wozo.GIF"));
JLabel namaz= new JLabel(new ImageIcon("images/namaz.GIF"));
JLabel taharat = new JLabel(new ImageIcon("images/taharat.GIF"));
JLabel faraz= new JLabel(new ImageIcon("images/faraz.GIF"));
JLabel wajeb= new JLabel(new ImageIcon("images/wajeb.GIF"));
JLabel makro = new JLabel(new ImageIcon("images/makro.GIF"));
JLabel mufsa= new JLabel(new ImageIcon("images/mufsadat.GIF"));
JLabel musthabahat = new JLabel(new ImageIcon("images/musthabat.GIF"));
JLabel rakat = new JLabel(new ImageIcon("images/rakat.gif"));
char tit2[]={0x0646,0x0645,0x0627,0x0632,' ',0x0643,0x06D2,' ',0x0645,0x0633,0x0627,0x0626,0x0644};
char namaz2[]={0x0646,0x0645,0x0627,0x0632};
char rakat2[]={0x0646,0x0645,0x0627,0x0632,' ',0x0643,0x0649,' ',0x0631,0x0643,0x0639,0x062A,0x064A,0x06BA};
char taharat2[]={0x0637,0x06C1,0x0627,0x0631,0x062A};
char wozo2[]={0x0648,0x0636,0x0648,' ',0x0643,0x0627,' ',0x0637,0x0631,0x0649,0x0642,0x06C1};
char gosal2[]={0x063A,0x0633,0x0644,' ',0x0643,0x0627,' ',0x0637,0x0631,0x0649,0x0642,0x06C1};
char faraz2[]={0x0646,0x0645,0x0627,0x0632,' ',0x0643,0x06D2,' ',0x0641,0x0631,0x0627,0x0626,0x0636};
char wajeb2[]={0x0646,0x0645,0x0627,0x0632,' ',0x0643,0x06D2,' ',0x0648,0x0627,0x062C,0x0628,0x0627,0x062A};
char makro2[]={0x0646,0x0645,0x0627,0x0632,' ',0x0643,0x06D2,' ',0x0645,0x0643,0x0631,0x0648,0x06C1,0x0627,0x062A};
char musfa2[]={0x0646,0x0645,0x0627,0x0632,' ',0x0643,0x06D2,' ',0x0645,0x0641,0x0633,0x0627,0x062F,0x0627,0x062A};
char mutha2[]={0x0646,0x0645,0x0627,0x0632,' ',0x0643,0x06D2,' ',0x0645,0x0633,0x062A,0x062D,0x0628,0x0627,0x062A};
String tit1=new String(tit2);
String namaz1=new String(namaz2);
String taharat1=new String(taharat2);
String wozo1=new String(wozo2);
String gosal1=new String(gosal2);
String rakat1=new String(rakat2);
String faraz1=new String(faraz2);
String wajeb1=new String(wajeb2);
String makro1=new String(makro2);
String musfa1=new String(musfa2);
String mutha1=new String(mutha2);
public salat() {
setBackground(new java.awt.Color (180,180, 150));
setLayout(null);
title.setFont(new java.awt.Font ("Urdu Naskh Unicode",1,22));
title.setForeground(new java.awt.Color (10,40,10));
title.setText(tit1);
title.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
title.setBounds(620, 5,150, 30);
add(title);
butnamaz.setText(namaz1);
butnamaz.setBackground(new java.awt.Color (180,180, 150));
butnamaz.setFont(new java.awt.Font ("Urdu Naskh Unicode",1,18));
butnamaz.setForeground(java.awt.Color.black);
butnamaz.setBounds(620, 40,150, 30);
butnamaz.addActionListener(this);
add(butnamaz);
buttaharat.setText(taharat1);
buttaharat.setBackground(new java.awt.Color (180,180, 150));
buttaharat.setFont(new java.awt.Font ("Urdu Naskh Unicode",1,18));
buttaharat.setForeground(java.awt.Color.black);
buttaharat.setBounds(620, 80,150, 30);
buttaharat.addActionListener(this);
add(buttaharat);
butwozo.setText(wozo1);
butwozo.setBackground(new java.awt.Color (180,180, 150));
butwozo.setFont(new java.awt.Font ("Urdu Naskh Unicode",1,18));
butwozo.setForeground(java.awt.Color.black);
butwozo.setBounds(620, 120,150, 30);
butwozo.addActionListener(this);
add(butwozo);
butgosal.setText(gosal1);
butgosal.setBackground(new java.awt.Color (180,180, 150));
butgosal.setFont(new java.awt.Font ("Urdu Naskh Unicode",1,18));
butgosal.setForeground(java.awt.Color.black);
butgosal.setBounds(620, 160,150, 30);
butgosal.addActionListener(this);
add(butgosal);
butrakat.setText(rakat1);
butrakat.setBackground(new java.awt.Color (180,180, 150));
butrakat.setFont(new java.awt.Font ("Urdu Naskh Unicode",1,18));
butrakat.setForeground(java.awt.Color.black);
butrakat.setBounds(620, 200,150, 30);
butrakat.addActionListener(this);
add( butrakat);
butfaraz.setText(faraz1);
butfaraz.setBackground(new java.awt.Color (180,180, 150));
butfaraz.setFont(new java.awt.Font ("Urdu Naskh Unicode",1,18));
butfaraz.setForeground(java.awt.Color.black);
butfaraz.setBounds(620, 240,150, 30);
butfaraz.addActionListener(this);
add(butfaraz);
butwajebat.setText(wajeb1);
butwajebat.setBackground(new java.awt.Color (180,180, 150));
butwajebat.setFont(new java.awt.Font ("Urdu Naskh Unicode",1,18));
butwajebat.setForeground(java.awt.Color.black);
butwajebat.setBounds(620, 280,150, 30);
butwajebat.addActionListener(this);
add(butwajebat);
butmakro.setText(makro1);
butmakro.setBackground(new java.awt.Color (180,180, 150));
butmakro.setFont(new java.awt.Font ("Urdu Naskh Unicode",1,18));
butmakro.setForeground(java.awt.Color.black);
butmakro.setBounds(620, 320,150, 30);
butmakro.addActionListener(this);
add(butmakro);
butmufsadat.setText(musfa1);
butmufsadat.setBackground(new java.awt.Color (180,180, 150));
butmufsadat.setFont(new java.awt.Font ("Urdu Naskh Unicode",1,18));
butmufsadat.setForeground(java.awt.Color.black);
butmufsadat.setBounds(620, 360,150, 30);
butmufsadat.addActionListener(this);
add(butmufsadat);
butmusthabat.setText(mutha1);
butmusthabat.setBackground(new java.awt.Color (180,180, 150));
butmusthabat.setFont(new java.awt.Font ("Urdu Naskh Unicode",1,18));
butmusthabat.setForeground(java.awt.Color.black);
butmusthabat.setBounds(620,400,150, 30);
butmusthabat.addActionListener(this);
add(butmusthabat);
scrollPanenamaz = new JScrollPane(namaz);
scrollPanenamaz.setBounds(90,5,500,450);
add(scrollPanenamaz, BorderLayout.CENTER);
scrollPanerakat = new JScrollPane(rakat);
scrollPanerakat.setBounds(110,5,405,225);
add(scrollPanerakat, BorderLayout.CENTER);
scrollPanewozo = new JScrollPane(wozo);
scrollPanewozo.setBounds(90,5,500,450);
add(scrollPanewozo, BorderLayout.CENTER);
scrollPanegosal = new JScrollPane(gosal);
scrollPanegosal.setBounds(90,5,500,450);
add(scrollPanegosal, BorderLayout.CENTER);
scrollPanetaharat = new JScrollPane(taharat);
scrollPanetaharat.setBounds(90,5,500,450);
add(scrollPanetaharat, BorderLayout.CENTER);
scrollPanefaraz = new JScrollPane(faraz);
scrollPanefaraz.setBounds(90,5,500,450);
add(scrollPanefaraz, BorderLayout.CENTER);
scrollPanewajeb= new JScrollPane(wajeb);
scrollPanewajeb.setBounds(90,5,500,450);
add(scrollPanewajeb, BorderLayout.CENTER);
scrollPanemufsa= new JScrollPane(mufsa);
scrollPanemufsa.setBounds(90,5,500,450);
add(scrollPanemufsa, BorderLayout.CENTER);
scrollPanemakro= new JScrollPane(makro);
scrollPanemakro.setBounds(90,5,500,450);
add(scrollPanemakro, BorderLayout.CENTER);
scrollPanemusthabhat= new JScrollPane(musthabahat);
scrollPanemusthabhat.setBackground(new java.awt.Color (180,180, 150));
scrollPanemusthabhat.setBounds(90,5,485,220);
add(scrollPanemusthabhat, BorderLayout.CENTER);
// label.setBounds(90,5,600,480);
// add(label);
}
public void actionPerformed(ActionEvent e) {
JButton button=(JButton)e.getSource();
if(button.equals(butwozo))
{
scrollPanenamaz.setVisible(false);
scrollPanetaharat.setVisible(false);
scrollPanewozo.setVisible(true);
scrollPanegosal.setVisible(false);
scrollPanefaraz.setVisible(false);
scrollPanewajeb.setVisible(false);
scrollPanemakro.setVisible(false);
scrollPanemusthabhat.setVisible(false);
scrollPanemufsa.setVisible(false);
scrollPanerakat.setVisible(false);
}
else if(button.equals(butrakat))
{
scrollPanenamaz.setVisible(false);
scrollPanetaharat.setVisible(false);
scrollPanewozo.setVisible(false);
scrollPanegosal.setVisible(false);
scrollPanefaraz.setVisible(false);
scrollPanewajeb.setVisible(false);
scrollPanemakro.setVisible(false);
scrollPanemusthabhat.setVisible(false);
scrollPanemufsa.setVisible(false);
scrollPanerakat.setVisible(true);
}
else if(button.equals(butgosal))
{
scrollPanenamaz.setVisible(false);
scrollPanetaharat.setVisible(false);
scrollPanewozo.setVisible(false);
scrollPanegosal.setVisible(true);
scrollPanefaraz.setVisible(false);
scrollPanewajeb.setVisible(false);
scrollPanemakro.setVisible(false);
scrollPanemusthabhat.setVisible(false);
scrollPanemufsa.setVisible(false);
scrollPanerakat.setVisible(false);
}
else if(button.equals(buttaharat))
{
scrollPanenamaz.setVisible(false);
scrollPanetaharat.setVisible(true);
scrollPanewozo.setVisible(false);
scrollPanegosal.setVisible(false);
scrollPanefaraz.setVisible(false);
scrollPanewajeb.setVisible(false);
scrollPanemakro.setVisible(false);
scrollPanemusthabhat.setVisible(false);
scrollPanemufsa.setVisible(false);
scrollPanerakat.setVisible(false);
}
else if(button.equals(butnamaz))
{
scrollPanenamaz.setVisible(true);
scrollPanetaharat.setVisible(false);
scrollPanewozo.setVisible(false);
scrollPanegosal.setVisible(false);
scrollPanefaraz.setVisible(false);
scrollPanewajeb.setVisible(false);
scrollPanemakro.setVisible(false);
scrollPanemusthabhat.setVisible(false);
scrollPanemufsa.setVisible(false);
scrollPanerakat.setVisible(false);
}
else if(button.equals(butfaraz))
{
scrollPanenamaz.setVisible(false);
scrollPanetaharat.setVisible(false);
scrollPanewozo.setVisible(false);
scrollPanegosal.setVisible(false);
scrollPanefaraz.setVisible(true);
scrollPanewajeb.setVisible(false);
scrollPanemakro.setVisible(false);
scrollPanemusthabhat.setVisible(false);
scrollPanemufsa.setVisible(false);
scrollPanerakat.setVisible(false);
}
else if(button.equals(butwajebat))
{
scrollPanenamaz.setVisible(false);
scrollPanetaharat.setVisible(false);
scrollPanewozo.setVisible(false);
scrollPanegosal.setVisible(false);
scrollPanefaraz.setVisible(false);
scrollPanewajeb.setVisible(true);
scrollPanemakro.setVisible(false);
scrollPanemusthabhat.setVisible(false);
scrollPanemufsa.setVisible(false);
scrollPanerakat.setVisible(false);
}
else if(button.equals(butmakro))
{
scrollPanenamaz.setVisible(false);
scrollPanetaharat.setVisible(false);
scrollPanewozo.setVisible(false);
scrollPanegosal.setVisible(false);
scrollPanefaraz.setVisible(false);
scrollPanewajeb.setVisible(false);
scrollPanemakro.setVisible(true);
scrollPanemusthabhat.setVisible(false);
scrollPanemufsa.setVisible(false);
scrollPanerakat.setVisible(false);
}
else if(button.equals(butmufsadat))
{
scrollPanenamaz.setVisible(false);
scrollPanetaharat.setVisible(false);
scrollPanewozo.setVisible(false);
scrollPanegosal.setVisible(false);
scrollPanefaraz.setVisible(false);
scrollPanewajeb.setVisible(false);
scrollPanemakro.setVisible(false);
scrollPanemusthabhat.setVisible(false);
scrollPanemufsa.setVisible(true);
scrollPanerakat.setVisible(false);
}
else if(button.equals(butmusthabat))
{
scrollPanenamaz.setVisible(false);
scrollPanetaharat.setVisible(false);
scrollPanewozo.setVisible(false);
scrollPanegosal.setVisible(false);
scrollPanefaraz.setVisible(false);
scrollPanewajeb.setVisible(false);
scrollPanemakro.setVisible(false);
scrollPanemusthabhat.setVisible(true);
scrollPanemufsa.setVisible(false);
scrollPanerakat.setVisible(false);
}
}
public static void main (String args[]) {
JFrame f = new JFrame ("JScrollPane Example");
JPanel j = new salat ();
f.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
f.getContentPane().add (j, BorderLayout.CENTER);
f. setSize(800,500);
f.show();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -