package quiz;import java.awt.Dimension;import java.awt.Toolkit;import  dịch - package quiz;import java.awt.Dimension;import java.awt.Toolkit;import  Anh làm thế nào để nói

package quiz;import java.awt.Dimens

package quiz;



import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;



public class Quiz_Fenster extends JFrame implements ActionListener {


/**
* Author : JaDaHB1, 30.11.2012
*/


//Bildschirmgre wird ausgelesen

Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();

private JLabel frage2;
private JButton ant[] = new JButton[4];



Fragen frage;
JFrame w1;
frage_change change;
Object[] options = { "OK"};
int lung;
JProgressBar b;
int richtig;


public Quiz_Fenster(){


//Fenster wird erstellt
w1 = new JFrame();

w1.setSize(400,300);
//Fenster wird auf die Mitte des Bildschirms gesetzt
w1.setLocation((int)(dim.getWidth()-400)/2,(int)(dim.getHeight()-300)/2);
w1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
w1.setVisible(true);

//Layout = NULL heisst wir legen x,y selber fest
w1.setLayout(null);



//Der erste Button ,und der ActionListener wird registriert damit auf Buttondruck reagiert werden kann
ant[0] = new JButton(" - ");
ant[0].setBounds(52,90,120,40);
ant[0].addActionListener(this);
//Button wird auf die Oberfl臘he hinzugef・t
w1.add(ant[0]);


ant[1] = new JButton(" - ");
ant[1].setBounds(52,160,120,40);
ant[1].addActionListener(this);
w1.add(ant[1]);


ant[2] = new JButton(" - ");
ant[2].setBounds(220,90,120,40);
ant[2].addActionListener(this);
w1.add(ant[2]);


ant[3] = new JButton(" - ");
ant[3].setBounds(220,160,120,40);
ant[3].addActionListener(this);
w1.add(ant[3]);

frage2 = new JLabel("Hier steht die Frage");
frage2.setBounds(52,15,250,40);
w1.add(frage2);

b = new JProgressBar(0,100);
b.setBounds(120,220,140,25);
b.setValue(0);
b.setStringPainted(true);

w1.add(b);

}




public static void main(String[] args) {


new frage_change();

}





public void actionPerformed(ActionEvent e){


//e.getSource heisst den Verursacher des Klicks,Lung ist die Richtige Antwort auf die Frage
//Wenn Button 1 Richtig
if(e.getSource()== ant[0]){

if (lung == 1){


Nachricht("Richtig","Weiter so...");

Prozent();
frage_change.neueFrage();


}else{

Nachricht("Falsch","Nicht so...");

}
}


//Wenn Button 2 richtig
if(e.getSource()== ant[1]){




if (lung == 2){

Nachricht("Richtig","Weiter so...");

Prozent();

frage_change.neueFrage();

}else{
Nachricht("Falsch","Nicht so...");
}
}


//Wenn Button 3 richtig
if(e.getSource() == ant[2]){

if (lung == 3){

Nachricht("Richtig","Weiter so...");

Prozent();

frage_change.neueFrage();

}else{

Nachricht("Falsch","Nicht so...");
}
}

//Wenn Button 4 richtig
if(e.getSource() == ant[3]){

if (lung == 4){

Nachricht("Richtig","Weiter so...");


Prozent();

frage_change.neueFrage();

}else{
Nachricht("Falsch","Nicht so...");
}
}


}



// Button Text 舅dern
public void ChangeTextButton(int button,String text){

ant[button-1].setText(text);

}
// Label Text 舅dern
public void ChangeTextLabel(String text){
frage2.setText(text);
}
// Umrechnen in Prozent
public void Prozentrechnung(int zahl,int gesamt){
b.setValue((int) 100/gesamt*zahl);
}
//Nachricht ausgeben
public void Nachricht(String Aussage,String info){
JOptionPane.showOptionDialog(null, Aussage, info,

JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE,

null, options, options[0]);
}

//Wenn alle Fragen beantwortet wurden.
public void Prozent (){

if (richtig
0/5000
Từ: -
Sang: -
Kết quả (Anh) 1: [Sao chép]
Sao chép!
package quiz;import java.awt.Dimension;import java.awt.Toolkit;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing. *;public class Quiz_Fenster extends JFrame implements ActionListener {} /** * Author: JaDaHB1, 30.11.2012 */ Bildschirmgre will be read out Dimension dim Toolkit.getDefaultToolkit().getScreenSize(); = private JLabel Q2; private JButton ant [] = new JButton [4]; Ask questions; JFrame w1; frage_change change; Object [] options = {"OK"}; int lung; JProgressBar b; int right; public Quiz_Fenster(){ Window is created W1 = new JFrame(); W1.setSize(400,300); Window is set to the middle of the screen W1.setLocation((int)(Dim.getWidth()-400)/2,(int)(Dim.GetHeight()-300)/2); W1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); W1.setVisible(true); Layout = NULL means we set x, y own W1.setLayout(null); The first button, and the ActionListener is registered so that it can respond to button pressure Ant [0] = new JButton("-"); Ant[0].SetBounds(52,90,120,40); Ant[0].addActionListener(this); Button is added on the Oberfl臘he W1.Add(Ant[0]); Ant [1] = new JButton("-"); Ant[1].SetBounds(52,160,120,40); Ant[1].addActionListener(this); W1.Add(Ant[1]); Ant [2] = new JButton("-"); Ant[2].SetBounds(220,90,120,40); Ant[2].addActionListener(this); W1.Add(Ant[2]); Ant [3] = new JButton("-"); Ant[3].SetBounds(220,160,120,40); Ant[3].addActionListener(this); W1.Add(Ant[3]); Q2 = new JLabel ("here the question is"); frage2.SetBounds(52,15,250,40); W1.Add(frage2); b = new JProgressBar(0,100); b.setBounds(120,220,140,25); b.setValue(0); b.setStringPainted(true); W1.Add(b); } public static void main(String[] args) {} new frage_change(); } public void actionPerformed (ActionEvent e) {} e.getSource is the originator of the clicks, solving is the right answer to the question If button 1 right If(e.getSource()== ant [0]) {} If (lung == 1) {} Nachricht("richtig","Weiter so..."); Prozent(); frage_change.neueFrage(); } else {} Nachricht("falsch","nicht so..."); } } If button 2 right If(e.getSource()== ant [1]) {} If (lung == 2) {} Nachricht("richtig","Weiter so..."); Prozent(); frage_change.neueFrage(); } else {} Nachricht("falsch","nicht so..."); } } If button 3 right If(e.getSource() == ant [2]) {} If (lung == 3) {} Nachricht("richtig","Weiter so..."); Prozent(); frage_change.neueFrage(); } else {} Nachricht("falsch","nicht so..."); } } When button 4 right If(e.getSource() == ant [3]) {} If (lung == 4) {} Nachricht("richtig","Weiter so..."); Prozent(); frage_change.neueFrage(); } else {} Nachricht("falsch","nicht so..."); } } } Button text present public void ChangeTextButton(int button,String text) {} Ant[button-1].SetText(text); } Label text present public void ChangeTextLabel (string text) {} frage2.SetText(text); } Conversion in percent public void percentages (int number, int total) {} b.setValue((int) 100/total * number); } Message public void Nachricht(String Aussage,String info) {} JOptionPane.showOptionDialog (null, statement, info, JOptionPane. DEFAULT_OPTION, JOptionPane. PLAIN_MESSAGE,. NULL, options, options [0]); } When all questions have been answered. public void percent () {} If (right < = 7) {} right += 1; Prozentrechnung(richtig, 8); } else {} Nachricht("super!","Herzlichen GL・kwunsch:)"); System.exit(0); } }}
đang được dịch, vui lòng đợi..
Kết quả (Anh) 2:[Sao chép]
Sao chép!
package quiz; import java.awt.Dimension; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; . import javax.swing *; public class extends JFrame implements ActionListener Quiz_Fenster { / ** * Author: JaDaHB1, 30.11.2012 * / // Bildschirmgre is read Dimension dim = Toolkit.getDefaultToolkit () getScreenSize ();. private JLabel frage2; private JButton ant [] = new JButton [4]; Questions ask; JFrame w1; frage_change change; Object [] options = {"OK"}; int lung; JProgressBar b, int right, public Quiz_Fenster () { // window is created w1 = new JFrame (); w1.setSize (400.300); // window is on the center of the screen = NULL means that we put x, y itself firmly w1.setLayout (null); // The first button, and the action listener can be registered in order to respond Button Print ant [0] = new JButton ("-"); ant [0 ] .setBounds (52,90,120,40); ant [0] .addActionListener (this); // button is on the surface臘he hinzugef · t w1.add (ant [0]); ant [1] = new JButton ("-"); ant [1] .setBounds (52,160,120,40); ant [1] .addActionListener (this); w1.add (ant [1]); ant [2] = new JButton ("-") ; ant [2] .setBounds (220,90,120,40); ant [2] .addActionListener (this); w1.add (ant [2]); ant [3] = new JButton ("-"); ant [ 3] .setBounds (220,160,120,40); ant [3] .addActionListener (this); w1.add (ant [3]); frage2 = new JLabel ("Here is the question"); frage2.setBounds (52,15,250 , 40); w1.add (frage2); b = new static void main (String [] args) { new frage_change (); } public void actionPerformed (ActionEvent e) { //e.getSource called the originator of clicks Lung is the correct answer to the question // if button 1 True if (e.getSource () == ant [0]) { if (lung == 1) { message ("Right," "Keep it up ..."); percent (); frage_change.neueFrage () ; } else { message ("false", "Not so ..."); } } // if button 2 correctly if (e.getSource () == ant [1]) { if (lung == 2 ) { message ("Right," "Keep it up ..."); percent (); frage_change.neueFrage (); } else { message ("false", "Not so ..."); } } // if Button 3 correctly if (e.getSource () == ant [2]) { if (lung == 3) { message ("Right," "Keep it up ..."); percent (); frage_change.neueFrage (); } else { message ("false", "Not so ..."); } } // if button 4 correctly if (e.getSource () == ant [3]) { if (lung = = 4) { message ("Right," "Keep it up ..."); percent (); frage_change.neueFrage (); } else { message ("false", "Not so ..."); } } } // Button Text舅countries public void Change Text button (int button, String text) { ant [button-1] .setText (text); } // label text舅countries public void Change Text Label (String text) { frage2.setText (text) ; } // Convert to percent public void percentage calculation (int number, int total) { b.setValue ((int) 100 / total * number); } // Output Message public void send (String message, String info) { JOptionPane. show option dialog (null statement, info, JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, options [0]); } // If all questions have been answered. public void percent () { if (right <= 7) { right + = 1; Percentage (yes, 8); } else { message ("Great!", "Thank smoothing kwunsch :)"); System.exit (0); } } }




































































































































































































































đang được dịch, vui lòng đợi..
Kết quả (Anh) 3:[Sao chép]
Sao chép!
package quiz;



import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import more java.awt.event.ActionListener;
import javax.swing.*;



public class Quiz_Fenster extends JFrame implements ActionListener {


/**
* author: JaDaHB1, 30.11.2012
*/


//Bildschirmgr  e becomes ausgelesen

dimension dim = tool kit GET default TARGET9_0_ kit () .getScreenSize ();

private JLabel frage2;
private JButton ant [] = new JButton [4];



questions ask;
JFrame w1;
frage_change CHANGEs;
Object [] option = {“OK ONES”};
l int  ung;
JProgressBar b;
int correctly;


public Quiz_Fenster () {


//Fenster becomes erstellt
w1 = new JFrame ();

w1.setSize (400,300);
//Fenster becomes on the center of the screen gesetzt
w1.setLocation ((int) (dim.getWidth () - 400)/2,(int) (dim.getHeight () - 300) /2);
w1.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
w1.setVisible (true);

//Layout = ZERO is called we puts x, y fest
w1.setLayout (zero);



//Der first button, and to which ActionListener registered with it to button printing are reacted kann
ant [0] = new JButton (” - “);
ant [0] .setBounds (52,90,120,40);
ant [0] more.addActionListener (this);
//Button becomes on the Oberfl 臘 he hinzugef ・ t
w1.add (ant [0]);


[1] = new JButton ant (” - “);
ant [1] .setBounds (52,160,120,40);
ant [1] more.addActionListener (this);
w1.add (ant [1]);


[2] = new JButton ant (” - “);
ant [2] .setBounds (220,90,120,40);
ant [2] more.addActionListener (this);
w1.add (ant [2]);


[3] = new JButton ant (” - “);
ant [3] .setBounds (220,160,120,40);
ant [3].more addActionListener (this);
w1.add (ant [3]);

frage2 = new JLabel (“here the question” stands);
frage2.setBounds (52,15,250,40);
w1.add (frage2);

b = new JProgressBar (0,100);
b.setBounds (120,220,140,25);
b.setValue (0);
b.setStringPainted (true);

w1.add (b);

}




public static void Main (string [] args) {


new frage_change ();

}





public void actionPerformed (ActionEvent e) {


//e.getSource is called the causer of the click, L  ung is the correct answer to the Frage
//Wenn button 1 correct
if (e.getSource () == ant [0]) {

if (l  ung == 1) {


message (“correct”, “far ones so…”);

percent ();
frage_change.neueFrage ();


} else {

message (“wrong”, “not so…”);

}
}


//Wenn button 2 richtig
if (e.GET SOURCE () == ant [1]) {




if (l  ung == 2) {

message (“correct”, “far ones so…”);

percent ();

frage_change.neueFrage ();

} else {
message (“wrong”, “not so…”);
}
}


//Wenn button 3 richtig
if (e.getSource () == ant [2]) {

if (l  ung == 3) {

message (“correct”, “far ones so…”);

percent ();

frage_change.neueFrage ();

} else {

message (“wrong”, “not so…”);
}
}

//Wenn button 4 richtig
if (e.getSource () == ant [3]) {

if (l  ung == 4) {

message (“correct”, “far ones so…”);


percent ();

frage_change.neueFrage ();

} else {
message (“wrong”, “not so…”);
}
}


}



//button text 舅 dern
public void CHANGE text button (button, string text int) {

ant [button-1] .setText (text);

}
//label text 舅 dern
public void CHANGE text label (string text) {
frage2.setText (text);
}
//converting into Prozent
public void calculation of percentage (int number, int entirely) {
b.setValue ((int) 100/gesamt*zahl);
}
//Nachricht ausgeben
public void message (string statement, string info) {
JOptionPane.showOptionDialog (zero, statement, info,

JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE,

zero, option, option [0]);
}

//Wenn all questions answers wurden.
public void percent () {

if (correctly <= 7) {

correctly = 1;
calculation of percentage (correct, 8);
} else {
message (“super! ”, “cordial Gl ・ kwunsch:)”);
system exit (0);

}
}
}


đang được dịch, vui lòng đợi..
 
Các ngôn ngữ khác
Hỗ trợ công cụ dịch thuật: Albania, Amharic, Anh, Armenia, Azerbaijan, Ba Lan, Ba Tư, Bantu, Basque, Belarus, Bengal, Bosnia, Bulgaria, Bồ Đào Nha, Catalan, Cebuano, Chichewa, Corsi, Creole (Haiti), Croatia, Do Thái, Estonia, Filipino, Frisia, Gael Scotland, Galicia, George, Gujarat, Hausa, Hawaii, Hindi, Hmong, Hungary, Hy Lạp, Hà Lan, Hà Lan (Nam Phi), Hàn, Iceland, Igbo, Ireland, Java, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Kurd, Kyrgyz, Latinh, Latvia, Litva, Luxembourg, Lào, Macedonia, Malagasy, Malayalam, Malta, Maori, Marathi, Myanmar, Mã Lai, Mông Cổ, Na Uy, Nepal, Nga, Nhật, Odia (Oriya), Pashto, Pháp, Phát hiện ngôn ngữ, Phần Lan, Punjab, Quốc tế ngữ, Rumani, Samoa, Serbia, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenia, Somali, Sunda, Swahili, Séc, Tajik, Tamil, Tatar, Telugu, Thái, Thổ Nhĩ Kỳ, Thụy Điển, Tiếng Indonesia, Tiếng Ý, Trung, Trung (Phồn thể), Turkmen, Tây Ban Nha, Ukraina, Urdu, Uyghur, Uzbek, Việt, Xứ Wales, Yiddish, Yoruba, Zulu, Đan Mạch, Đức, Ả Rập, dịch ngôn ngữ.

Copyright ©2024 I Love Translation. All reserved.

E-mail: