Subtrees hinzugefügt

This commit is contained in:
Thomas Schaller 2025-01-02 12:26:47 +01:00
parent 433a6f2eb1
commit a02bf698e6
19 changed files with 2775 additions and 0 deletions

View file

@ -0,0 +1,5 @@
*.class
*.ctxt
*.sh
repo.adoc
*.~lock

View file

@ -0,0 +1,150 @@
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
/**
*
* GUI zur Anzeige einer einzigen Frage des Quizspiels
*
* @version 1.0 from 15.11.2016
* @author Thomas Schaller
*/
public class FrageGUI extends JDialog {
// Anfang Attribute
private JLabel jLabel1 = new JLabel();
private JLabel jLFrage = new JLabel();
private JButton jB_A1 = new JButton();
private JButton jB_A2 = new JButton();
private JButton jB_A3 = new JButton();
private JButton jB_A4 = new JButton();
private JLabel jLName = new JLabel();
private JPanel jPanel1 = new JPanel(null, true);
private int antwort = -1;
// Ende Attribute
public FrageGUI (JFrame owner, String frage, String a1, String a2, String a3, String a4, int sp) {
super (owner, true);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
int frameWidth = 657;
int frameHeight = 447;
setSize(frameWidth, frameHeight);
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
int x = (d.width - getSize().width) / 2;
int y = (d.height - getSize().height) / 2;
setLocation(x, y);
Container cp = getContentPane();
cp.setLayout(null);
// Anfang Komponenten
jLabel1.setBounds(8, 8, 78, 81);
jLabel1.setText("<html><p >Frage:</p></html>");
jLabel1.setFont(new Font("Dialog", Font.BOLD, 20));
jLabel1.setVerticalTextPosition(JLabel.TOP);
cp.add(jLabel1);
jLFrage.setBounds(96, 0, 534, 97);
jLFrage.setText("<html>"+frage+"</html>");
jLFrage.setFont(new Font("Dialog", Font.BOLD, 20));
jLFrage.setVerticalTextPosition(SwingConstants.TOP);
cp.add(jLFrage);
jB_A1.setBounds(8, 96, 329, 121);
jB_A1.setText("<html><p align=center valign=top>"+a1+"</p></html>");
jB_A1.setMargin(new Insets(2, 2, 2, 2));
jB_A1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
jB_A1_ActionPerformed(evt);
}
});
jB_A1.setFont(new Font("Dialog", Font.BOLD, 16));
jB_A1.setBackground(new Color(0xB8CFE5));
jB_A1.setHorizontalTextPosition(SwingConstants.CENTER);
cp.add(jB_A1);
jB_A2.setBounds(352, 96, 281, 121);
jB_A2.setText("<html><p align=center>"+a2+"</p></html>");
jB_A2.setMargin(new Insets(2, 2, 2, 2));
jB_A2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
jB_A2_ActionPerformed(evt);
}
});
jB_A2.setFont(new Font("Dialog", Font.BOLD, 16));
jB_A2.setBackground(new Color(0xB8CFE5));
cp.add(jB_A2);
jB_A3.setBounds(8, 224, 329, 137);
jB_A3.setText("<html><p align=center>"+a3+"</p></html>");
jB_A3.setMargin(new Insets(2, 2, 2, 2));
jB_A3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
jB_A3_ActionPerformed(evt);
}
});
jB_A3.setFont(new Font("Dialog", Font.BOLD, 16));
jB_A3.setBackground(new Color(0xB8CFE5));
cp.add(jB_A3);
jB_A4.setBounds(352, 224, 281, 137);
jB_A4.setText("<html><p align=center>"+a4+"</p></html>");
jB_A4.setMargin(new Insets(2, 2, 2, 2));
jB_A4.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
jB_A4_ActionPerformed(evt);
}
});
jB_A4.setFont(new Font("Dialog", Font.BOLD, 16));
jB_A4.setBackground(new Color(0xB8CFE5));
cp.add(jB_A4);
jLName.setBounds(8, 360, 624, 45);
jLName.setText("Spieler "+sp+" entscheide dich!");
jLName.setFont(new Font("Dialog", Font.BOLD, 24));
cp.add(jLName);
setUndecorated(true);
jPanel1.setBounds(0, 0, 641, 409);
jPanel1.setOpaque(false);
jPanel1.setBorder(new javax.swing.border.LineBorder(Color.BLACK, 2));
cp.add(jPanel1);
// Ende Komponenten
setResizable(false);
}
// Anfang Methoden
public void jB_A1_ActionPerformed(ActionEvent evt) {
antwort = 1;
jB_A1.setEnabled(false);
this.setVisible(false);
} // end of jB_A1_ActionPerformed
public void jB_A2_ActionPerformed(ActionEvent evt) {
antwort = 2;
jB_A2.setEnabled(false);
this.setVisible(false);
} // end of jB_A2_ActionPerformed
public void jB_A3_ActionPerformed(ActionEvent evt) {
antwort = 3;
jB_A3.setEnabled(false);
this.setVisible(false);
} // end of jB_A3_ActionPerformed
public void jB_A4_ActionPerformed(ActionEvent evt) {
antwort = 4;
jB_A4.setEnabled(false);
this.setVisible(false);
} // end of jB_A4_ActionPerformed
public int getAntwort() {
return antwort;
}
public void setSpieler(int sp) {
jLName.setText("Spieler "+sp+" entscheide dich!");
}
// Ende Methoden
}

View file

@ -0,0 +1,303 @@
object frageGUI: TFGUIForm
Left = 160
Top = 45
BorderIcons = [biSystemMenu]
Caption = 'FrageGUI'
ClientHeight = 408
ClientWidth = 641
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -10
Font.Name = 'MS Sans Serif'
Font.Style = []
FormStyle = fsMDIChild
OldCreateOrder = True
Position = poDesigned
ShowHint = True
Visible = True
OnClose = FormClose
OnCloseQuery = FormCloseQuery
OnResize = FormResize
FrameType = 5
Resizable = False
Undecorated = True
Background = clBtnFace
PixelsPerInch = 96
TextHeight = 13
object jPanel1: TJPanel
Tag = 12
Left = 0
Top = 0
Width = 641
Height = 409
Hint = 'jPanel1'
Foreground = 3355443
Background = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Dialog'
Font.Style = [fsBold]
Border.BorderType = LineBorder
Border.LineColor = clBlack
Border.LineThickness = 2
Border.LineRounded = False
Border.EtchHighlightColor = clBlack
Border.EtchShadowColor = clBlack
Border.Etchtype = 0
Border.BevelHighlightColor = clBlack
Border.BevelShadowColor = clBlack
Border.Beveltype = 0
Border.MatteColor = clBlack
Border.MatteTop = 0
Border.MatteLeft = 0
Border.MatteBottom = 0
Border.MatteRight = 0
end
object jB_A1: TJButton
Tag = 4
Left = 8
Top = 96
Width = 329
Height = 121
Hint = 'jButton1'
Foreground = clWindowText
Background = 15060920
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Dialog'
Font.Style = [fsBold]
actionPerformed = 'jB_A1_ActionPerformed'
Text = 'jButtonA1'
Mnemonic = 0
DisplayedMnemonicIndex = 0
Selected = False
BorderPainted = True
FocusPainted = False
ContentAreaFilled = True
HorizontalAlignment = CENTER
VerticalAlignment = CENTER
HorizontalTextPosition = CENTER
VerticalTextPosition = CENTER
IconTextGap = 4
RolloverEnabled = False
Border.BorderType = NoBorder
Border.LineColor = clBlack
Border.LineThickness = 0
Border.LineRounded = False
Border.EtchHighlightColor = clBlack
Border.EtchShadowColor = clBlack
Border.Etchtype = 0
Border.BevelHighlightColor = clBlack
Border.BevelShadowColor = clBlack
Border.Beveltype = 0
Border.MatteColor = clBlack
Border.MatteTop = 0
Border.MatteLeft = 0
Border.MatteBottom = 0
Border.MatteRight = 0
end
object jB_A2: TJButton
Tag = 4
Left = 352
Top = 96
Width = 281
Height = 121
Hint = 'jButton2'
Foreground = clWindowText
Background = 15060920
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Dialog'
Font.Style = [fsBold]
actionPerformed = 'jB_A2_ActionPerformed'
Text = 'jButton2'
Mnemonic = 0
DisplayedMnemonicIndex = 0
Selected = False
BorderPainted = True
FocusPainted = False
ContentAreaFilled = True
HorizontalAlignment = CENTER
VerticalAlignment = CENTER
HorizontalTextPosition = RIGHT
VerticalTextPosition = CENTER
IconTextGap = 4
RolloverEnabled = False
Border.BorderType = NoBorder
Border.LineColor = clBlack
Border.LineThickness = 0
Border.LineRounded = False
Border.EtchHighlightColor = clBlack
Border.EtchShadowColor = clBlack
Border.Etchtype = 0
Border.BevelHighlightColor = clBlack
Border.BevelShadowColor = clBlack
Border.Beveltype = 0
Border.MatteColor = clBlack
Border.MatteTop = 0
Border.MatteLeft = 0
Border.MatteBottom = 0
Border.MatteRight = 0
end
object jB_A3: TJButton
Tag = 4
Left = 8
Top = 224
Width = 329
Height = 137
Hint = 'jButton3'
Foreground = clWindowText
Background = 15060920
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Dialog'
Font.Style = [fsBold]
actionPerformed = 'jB_A3_ActionPerformed'
Text = 'jButton3'
Mnemonic = 0
DisplayedMnemonicIndex = 0
Selected = False
BorderPainted = True
FocusPainted = False
ContentAreaFilled = True
HorizontalAlignment = CENTER
VerticalAlignment = CENTER
HorizontalTextPosition = RIGHT
VerticalTextPosition = CENTER
IconTextGap = 4
RolloverEnabled = False
Border.BorderType = NoBorder
Border.LineColor = clBlack
Border.LineThickness = 0
Border.LineRounded = False
Border.EtchHighlightColor = clBlack
Border.EtchShadowColor = clBlack
Border.Etchtype = 0
Border.BevelHighlightColor = clBlack
Border.BevelShadowColor = clBlack
Border.Beveltype = 0
Border.MatteColor = clBlack
Border.MatteTop = 0
Border.MatteLeft = 0
Border.MatteBottom = 0
Border.MatteRight = 0
end
object jB_A4: TJButton
Tag = 4
Left = 352
Top = 224
Width = 281
Height = 137
Hint = 'jButton4'
Foreground = clWindowText
Background = 15060920
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Dialog'
Font.Style = [fsBold]
actionPerformed = 'jB_A4_ActionPerformed'
Text = 'jButton4'
Mnemonic = 0
DisplayedMnemonicIndex = 0
Selected = False
BorderPainted = True
FocusPainted = False
ContentAreaFilled = True
HorizontalAlignment = CENTER
VerticalAlignment = CENTER
HorizontalTextPosition = RIGHT
VerticalTextPosition = CENTER
IconTextGap = 4
RolloverEnabled = False
Border.BorderType = NoBorder
Border.LineColor = clBlack
Border.LineThickness = 0
Border.LineRounded = False
Border.EtchHighlightColor = clBlack
Border.EtchShadowColor = clBlack
Border.Etchtype = 0
Border.BevelHighlightColor = clBlack
Border.BevelShadowColor = clBlack
Border.Beveltype = 0
Border.MatteColor = clBlack
Border.MatteTop = 0
Border.MatteLeft = 0
Border.MatteBottom = 0
Border.MatteRight = 0
end
object jLName: TJLabel
Tag = 1
Left = 8
Top = 360
Width = 624
Height = 45
Hint = 'jLabel2'
Foreground = clWindowText
Background = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -24
Font.Name = 'Dialog'
Font.Style = [fsBold]
Text = 'Spieler 1 entscheide dich!'
HorizontalAlignment = LEFT
VerticalAlignment = CENTER
HorizontalTextPosition = RIGHT
VerticalTextPosition = CENTER
IconTextGap = 4
DisplayedMnemonic = 0
DisplayedMnemonicIndex = 0
end
object jLFrage: TJLabel
Tag = 1
Left = 96
Top = 0
Width = 534
Height = 97
Hint = 'jLabel2'
Foreground = clWindowText
Background = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -24
Font.Name = 'Dialog'
Font.Style = [fsBold]
Text = 'text'
HorizontalAlignment = LEFT
VerticalAlignment = CENTER
HorizontalTextPosition = RIGHT
VerticalTextPosition = TOP
IconTextGap = 4
DisplayedMnemonic = 0
DisplayedMnemonicIndex = 0
end
object jLabel1: TJLabel
Tag = 1
Left = 8
Top = 8
Width = 78
Height = 81
Hint = 'jLabel1'
Foreground = clWindowText
Background = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -24
Font.Name = 'Dialog'
Font.Style = [fsBold]
Text = '<html><p valign=top>Frage: </p></html>'
HorizontalAlignment = LEFT
VerticalAlignment = CENTER
HorizontalTextPosition = RIGHT
VerticalTextPosition = TOP
IconTextGap = 4
DisplayedMnemonic = 0
DisplayedMnemonicIndex = 0
end
end

View file

@ -0,0 +1,90 @@
import java.awt.AlphaComposite;
import java.awt.Composite;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import javax.swing.ImageIcon;
import javax.swing.*;
/**
*
* GUI Element zur Anzeige eines Textes vor einem Hintergrundbild
*
* @version 1.0 from 15.11.2016
* @author Thomas Schaller
*/
public class ImageLabel extends JPanel{
protected ImageIcon image;
protected Dimension sizeImage;
protected String text;
public ImageLabel(ImageIcon image) {
super();
this.image = image;
init();
}
public ImageLabel(ImageIcon image, String text) {
super();
this.image = image;
this.text = text;
init();
}
private void init() {
sizeImage=new Dimension(image.getIconHeight(),image.getIconWidth());
}
public ImageIcon getImageIcon() {
return image;
}
public void setImageIcon(ImageIcon image) {
this.image = image;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D graphics2D = (Graphics2D) g;
// graphics2D.fillRect(0,0,this.getWidth(),this.getHeight());
Composite old=graphics2D.getComposite();
if(image!=null)
{
//graphics2D.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.4f));
graphics2D.drawImage(image.getImage(),0,0,
this.getWidth(),this.getHeight(),null);
}
graphics2D.setComposite(old);
graphics2D.drawString(text, 8, 40);
}
public Dimension getSizeImage() {
return sizeImage;
}
public void setSizeImage(Dimension sizeImage) {
this.sizeImage = sizeImage;
}
}

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,355 @@
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.io.*;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
import org.jdom.output.XMLOutputter;
/**
*
* Quizspiel zur Wiederholung von Unterrichtsinhalten
*
* @version 1.1 from 23.02.2017
* @author Thomas Schaller
*/
public class Quizspiel extends JFrame {
// Anfang Attribute
private ImageLabel jLabel1;
private ImageIcon jLabel1Icon = new ImageIcon("images/Titelleiste_Netzwerk.png");
private JPanel jPanel1 = new JPanel(null, true);
private JLabel jLabel2 = new JLabel();
private JPanel jPanel2 = new JPanel(null, true);
private JPanel jPanel3 = new JPanel(null, true);
private JLabel jLStatus = new JLabel();
private JPanel jPanel4 = new JPanel(null, true);
private JButton jBEnde = new JButton();
private JPanel jPSpieler1 = new JPanel(null, true);
private JLabel jLName1 = new JLabel();
private JLabel jLPunkte1 = new JLabel();
private JPanel jPSpieler2 = new JPanel(null, true);
private JLabel jLName2 = new JLabel();
private JLabel jLPunkte2 = new JLabel();
private JPanel jPSpieler3 = new JPanel(null, true);
private JLabel jLName3 = new JLabel();
private JLabel jLPunkte3 = new JLabel();
private JPanel jPSpieler4 = new JPanel(null, true);
private JLabel jLName4 = new JLabel();
private JLabel jLPunkte4 = new JLabel();
private JLabel jLabel4 = new JLabel();
private JButton[][] jBTopics;
private int akt_sp = 0;
private int sp_anz = 4;
private int[] punkte = new int[4];
private Document doc = null;
// Ende Attribute
public Quizspiel (String title) {
super (title);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
int frameWidth = 1026;
int frameHeight = 580;
setSize(frameWidth, frameHeight);
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
int x = (d.width - getSize().width) / 2;
int y = (d.height - getSize().height) / 2;
setLocation(x, y);
Container cp = getContentPane();
cp.setLayout(null);
// Anfang Komponenten
jLabel1 = new ImageLabel(jLabel1Icon, "Quiz");
jLabel1.setBounds(2, 2, 1019, 65);
jLabel1.setText("Quiz");
jLabel1.setImageIcon(jLabel1Icon);
jLabel1.setFont(new Font("Dialog", Font.BOLD, 30));
jLabel1.setForeground(Color.white);
cp.add(jLabel1);
jLabel4.setBounds(310, 553, 400, 20);
jLabel4.setText("(cc) Schaller (ZPG Informatik) - V1.1 (2017)");
jLabel4.setHorizontalAlignment(SwingConstants.CENTER);
jLabel4.setFont(new Font("Dialog", Font.PLAIN, 12));
cp.add(jLabel4);
setUndecorated(true);
jLStatus.setBounds(8, 488, 1011, 57);
jLStatus.setText(" Wähle bitte eine Frage...");
jLStatus.setBackground(Color.GRAY);
jLStatus.setOpaque(true);
jLStatus.setFont(new Font("Dialog", Font.BOLD, 24));
jLStatus.setForeground(Color.WHITE);
cp.add(jLStatus);
jPanel4.setBounds(0, 0, 1026, 553);
jPanel4.setOpaque(false);
jPanel4.setBorder(new javax.swing.border.LineBorder(Color.BLACK, 2));
cp.add(jPanel4);
jPSpieler1.setBounds(832, 72, 185, 89);
jPSpieler1.setOpaque(true);
jPSpieler1.setBorder(BorderFactory.createBevelBorder(1, Color.WHITE, Color.BLACK));
jPSpieler1.setBackground(new Color(0xB8CFE5));
jPanel4.add(jPSpieler1);
jLName1.setBounds(8, 8, 174, 33);
jLName1.setText("Spieler 1");
jLName1.setFont(new Font("Dialog", Font.BOLD, 24));
jLName1.setForeground(new Color(0x000080));
jLName1.setHorizontalTextPosition(SwingConstants.CENTER);
jPSpieler1.add(jLName1);
jLPunkte1.setBounds(11, 48, 166, 33);
jLPunkte1.setText("0 Punkte");
jLPunkte1.setForeground(new Color(0x800000));
jLPunkte1.setFont(new Font("Dialog", Font.BOLD, 24));
jLPunkte1.setHorizontalTextPosition(SwingConstants.CENTER);
jPSpieler1.add(jLPunkte1);
jPSpieler2.setBounds(832, 160, 185, 89);
jPSpieler2.setOpaque(true);
jPSpieler2.setBorder(BorderFactory.createBevelBorder(1, Color.WHITE, Color.BLACK));
jPanel4.add(jPSpieler2);
jLName2.setBounds(8, 8, 174, 33);
jLName2.setText("Spieler 2");
jLName2.setFont(new Font("Dialog", Font.BOLD, 24));
jLName2.setForeground(new Color(0x000080));
jLName2.setHorizontalTextPosition(SwingConstants.CENTER);
jPSpieler2.add(jLName2);
jLPunkte2.setBounds(11, 48, 166, 33);
jLPunkte2.setText("0 Punkte");
jLPunkte2.setFont(new Font("Dialog", Font.BOLD, 24));
jLPunkte2.setForeground(new Color(0x800000));
jLPunkte2.setHorizontalTextPosition(SwingConstants.CENTER);
jPSpieler2.add(jLPunkte2);
jPSpieler3.setBounds(832, 248, 185, 89);
jPSpieler3.setOpaque(true);
jPSpieler3.setBorder(BorderFactory.createBevelBorder(1, Color.WHITE, Color.BLACK));
jPSpieler3.setBackground(new Color(0xEEEEEE));
jPanel4.add(jPSpieler3);
jLName3.setBounds(8, 8, 174, 33);
jLName3.setText("Spieler 3");
jLName3.setFont(new Font("Dialog", Font.BOLD, 24));
jLName3.setForeground(new Color(0x000080));
jLName3.setHorizontalTextPosition(SwingConstants.CENTER);
jPSpieler3.add(jLName3);
jLPunkte3.setBounds(11, 48, 166, 33);
jLPunkte3.setText("0 Punkte");
jLPunkte3.setFont(new Font("Dialog", Font.BOLD, 24));
jLPunkte3.setForeground(new Color(0x800000));
jLPunkte3.setHorizontalTextPosition(SwingConstants.CENTER);
jPSpieler3.add(jLPunkte3);
jPSpieler4.setBounds(832, 336, 185, 89);
jPSpieler4.setOpaque(true);
jPSpieler4.setBorder(BorderFactory.createBevelBorder(1, Color.WHITE, Color.BLACK));
jPSpieler4.setBackground(new Color(0xEEEEEE));
jPanel4.add(jPSpieler4);
jLName4.setBounds(8, 8, 174, 33);
jLName4.setText("Spieler 4");
jLName4.setFont(new Font("Dialog", Font.BOLD, 24));
jLName4.setForeground(new Color(0x000080));
jLName4.setHorizontalTextPosition(SwingConstants.CENTER);
jPSpieler4.add(jLName4);
jLPunkte4.setBounds(11, 48, 166, 33);
jLPunkte4.setText("0 Punkte");
jLPunkte4.setFont(new Font("Dialog", Font.BOLD, 24));
jLPunkte4.setForeground(new Color(0x800000));
jLPunkte4.setHorizontalTextPosition(SwingConstants.CENTER);
jPSpieler4.add(jLPunkte4);
jBEnde.setBounds(832, 432, 185, 49);
jBEnde.setText("Spiel beenden");
jBEnde.setMargin(new Insets(2, 2, 2, 2));
jBEnde.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
jBEnde_ActionPerformed(evt);
}
});
jBEnde.setFont(new Font("Dialog", Font.BOLD, 24));
jPanel4.add(jBEnde);
// Ende Komponenten
readQuestions();
jLabel1.setText("Quiz: "+doc.getRootElement().getChild("Titel").getValue());
jBTopics = new JButton[getAnzKategorien()][getAnzTopics()];
for (x = 0; x < getAnzKategorien() ; x++) {
JPanel jPanel = new JPanel();
jPanel.setBounds(2+193*x, 85, 193, 65);
jPanel.setOpaque(false);
jPanel.setBorder(BorderFactory.createBevelBorder(0, Color.WHITE, Color.BLACK));
jPanel4.add(jPanel);
JLabel jLabel = new JLabel();
jLabel.setBounds(80, 60, 193, 64);
jLabel.setText("<html><p width=190 align=center>"+getKategorie(x)+"</p></html>");
jLabel.setHorizontalAlignment(SwingConstants.CENTER);
jLabel.setFont(new Font("Dialog", Font.BOLD, 24));
jPanel.add(jLabel);
for (y = 0; y < getAnzTopics() ; y++ ) {
jBTopics[x][y] = new JButton();
jBTopics[x][y].setText(getTopic(x,y).getChild("Punkte").getValue());
jBTopics[x][y].setBounds(2+193*x, 150+y*65, 193, 65);
jBTopics[x][y].setMargin(new Insets(2,2,2,2));
jBTopics[x][y].setFont(new Font("Dialog", Font.BOLD, 36));
jBTopics[x][y].addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
button_ActionPerformed(evt);
}
});
jPanel4.add(jBTopics[x][y]);
} // end of for
} // end of for
setResizable(false);
setVisible(true);
sp_anz = 0;
while (sp_anz <2 || sp_anz > 4) {
String s = javax.swing.JOptionPane.showInputDialog( "Bitte Anzahl der Spieler eingeben (2-4):" );
try{
int i = Integer.parseInt( s );
sp_anz = i;
} catch (Exception e) {
}
} // end of while
jPSpieler4.setVisible(sp_anz >= 4);
jPSpieler3.setVisible(sp_anz >= 3);
// end of if
}
// Anfang Methoden
public void button_ActionPerformed(ActionEvent evt) {
int x = 0;
int y = 0;
for (int i=0;i<getAnzKategorien() ;i++ ) {
for (int j=0;j<getAnzTopics();j++) {
if (evt.getSource()==jBTopics[i][j]) {x = i; y = j; }
} // end of for
} // end of for
int akt_f_sp = akt_sp;
Element t = getTopic(x,y);
int richtig = Integer.parseInt(t.getChild("Richtig").getValue());
FrageGUI frage = new FrageGUI(this, t.getChild("Frage").getValue(), ((Element) t.getChildren("Antwort").get(0)).getValue(),((Element) t.getChildren("Antwort").get(1)).getValue(),((Element) t.getChildren("Antwort").get(2)).getValue(),((Element) t.getChildren("Antwort").get(3)).getValue(), akt_f_sp+1);
while (frage.getAntwort()!=richtig) {
frage.setVisible(true);
if (frage.getAntwort()!=richtig) {
jLStatus.setText("<html>&nbsp;Die Antwort war leider falsch!</html>");
akt_f_sp = (akt_f_sp + 1)%sp_anz;
frage.setSpieler((akt_f_sp+1));
try{
Thread.sleep(200); }
catch(Exception e) {
}
} // end of if-else
} // end of while
akt_sp = (akt_sp+1)%sp_anz;
punkte[akt_f_sp] += Integer.parseInt(t.getChild("Punkte").getValue());
jLStatus.setText("<html>&nbsp;Die Antwort ist richtig. Spieler "+(akt_f_sp+1)+" erhält "+Integer.parseInt(t.getChild("Punkte").getValue())+" Punkte. Spieler "+(akt_sp+1)+" wähle bitte eine Frage...</html>");
((JButton) (evt.getSource())).setEnabled(false);
showPunkte();
} // end of jButton1_ActionPerformed
public void jBEnde_ActionPerformed(ActionEvent evt) {
this.setVisible(false);
this.dispose();
} // end of jBEnde_ActionPerformed
// Ende Methoden
public void showPunkte() {
jLPunkte1.setText(""+punkte[0]+" Punkte");
jLPunkte2.setText(""+punkte[1]+" Punkte");
jLPunkte3.setText(""+punkte[2]+" Punkte");
jLPunkte4.setText(""+punkte[3]+" Punkte");
if (akt_sp==0) {
jPSpieler1.setBackground(new Color(0xB8CFE5));
} else {
jPSpieler1.setBackground(new Color(0xEFEFEF));
} // end of if-else
jPSpieler2.setBackground(new Color(0xEEEEEE));
if (akt_sp==1) {
jPSpieler2.setBackground(new Color(0xB8CFE5));
} else {
jPSpieler2.setBackground(new Color(0xEFEFEF));
} // end of if-else
if (akt_sp==2) {
jPSpieler3.setBackground(new Color(0xB8CFE5));
} else {
jPSpieler3.setBackground(new Color(0xEFEFEF));
} // end of if-else
if (akt_sp==3) {
jPSpieler4.setBackground(new Color(0xB8CFE5));
} else {
jPSpieler4.setBackground(new Color(0xEFEFEF));
} // end of if-else
}
public int getAnzKategorien() {
return doc.getRootElement().getChildren("Kategorie").size();
}
public String getKategorie(int x) {
Element kat = (Element) doc.getRootElement().getChildren("Kategorie").get(x);
return kat.getAttributeValue("name");
}
public int getAnzTopics() {
Element kat0 = (Element) doc.getRootElement().getChildren("Kategorie").get(0);
return kat0.getChildren("Frage").size();
}
public Element getTopic(int x, int y) {
Element kategorie = (Element) (doc.getRootElement().getChildren("Kategorie").get(x));
Element topic = (Element) (kategorie.getChildren("Frage")).get(y);
return topic;
}
public void readQuestions() {
doc = null;
InputStream is = Quizspiel.class.getResourceAsStream("questions.xml");
File f = new File("questions.xml");
try {
// Das Dokument erstellen
SAXBuilder builder = new SAXBuilder();
doc = builder.build(f);
} catch (JDOMException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
new Quizspiel("Quizspiel");
}
}

View file

@ -0,0 +1,787 @@
object quizspiel: TFGUIForm
Left = 0
Top = -88
BorderIcons = [biSystemMenu]
Caption = 'Quizspiel'
ClientHeight = 552
ClientWidth = 1030
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -10
Font.Name = 'MS Sans Serif'
Font.Style = []
FormStyle = fsMDIChild
OldCreateOrder = True
Position = poDesigned
ShowHint = True
Visible = True
WindowState = wsMaximized
OnClose = FormClose
OnCloseQuery = FormCloseQuery
OnResize = FormResize
FrameType = 5
Resizable = False
Undecorated = True
Background = clBtnFace
PixelsPerInch = 96
TextHeight = 13
object jPanel2: TJPanel
Tag = 12
Left = 192
Top = 72
Width = 193
Height = 65
Hint = 'jPanel1'
Foreground = 3355443
Background = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Dialog'
Font.Style = [fsBold]
Border.BorderType = BevelBorder
Border.LineColor = clBlack
Border.LineThickness = 0
Border.LineRounded = False
Border.EtchHighlightColor = clWhite
Border.EtchShadowColor = clBlack
Border.Etchtype = 0
Border.BevelHighlightColor = clWhite
Border.BevelShadowColor = clBlack
Border.Beveltype = 0
Border.MatteColor = clBlack
Border.MatteTop = 0
Border.MatteLeft = 0
Border.MatteBottom = 0
Border.MatteRight = 0
end
object jPanel3: TJPanel
Tag = 12
Left = 384
Top = 72
Width = 193
Height = 65
Hint = 'jPanel1'
Foreground = 3355443
Background = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Dialog'
Font.Style = [fsBold]
Border.BorderType = BevelBorder
Border.LineColor = clBlack
Border.LineThickness = 0
Border.LineRounded = False
Border.EtchHighlightColor = clWhite
Border.EtchShadowColor = clBlack
Border.Etchtype = 0
Border.BevelHighlightColor = clWhite
Border.BevelShadowColor = clBlack
Border.Beveltype = 0
Border.MatteColor = clBlack
Border.MatteTop = 0
Border.MatteLeft = 0
Border.MatteBottom = 0
Border.MatteRight = 0
end
object jPanel4: TJPanel
Tag = 12
Left = 0
Top = 0
Width = 1026
Height = 553
Hint = 'jPanel4'
Foreground = 3355443
Background = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Dialog'
Font.Style = [fsBold]
Border.BorderType = LineBorder
Border.LineColor = clBlack
Border.LineThickness = 2
Border.LineRounded = False
Border.EtchHighlightColor = clBlack
Border.EtchShadowColor = clBlack
Border.Etchtype = 0
Border.BevelHighlightColor = clBlack
Border.BevelShadowColor = clBlack
Border.Beveltype = 0
Border.MatteColor = clBlack
Border.MatteTop = 0
Border.MatteLeft = 0
Border.MatteBottom = 0
Border.MatteRight = 0
object jPSpieler1: TJPanel
Tag = 12
Left = 832
Top = 72
Width = 185
Height = 89
Hint = 'jPanel5'
Foreground = 3355443
Background = 15060920
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Dialog'
Font.Style = [fsBold]
Border.BorderType = BevelBorder
Border.LineColor = clBlack
Border.LineThickness = 0
Border.LineRounded = False
Border.EtchHighlightColor = clBlack
Border.EtchShadowColor = clBlack
Border.Etchtype = 0
Border.BevelHighlightColor = clWhite
Border.BevelShadowColor = clBlack
Border.Beveltype = 1
Border.MatteColor = clBlack
Border.MatteTop = 0
Border.MatteLeft = 0
Border.MatteBottom = 0
Border.MatteRight = 0
object jLName1: TJLabel
Tag = 1
Left = 8
Top = 8
Width = 174
Height = 33
Hint = 'jLabel3'
Foreground = clNavy
Background = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clNavy
Font.Height = -24
Font.Name = 'Dialog'
Font.Style = [fsBold]
Text = 'Spieler 1'
HorizontalAlignment = LEFT
VerticalAlignment = CENTER
HorizontalTextPosition = CENTER
VerticalTextPosition = CENTER
IconTextGap = 4
DisplayedMnemonic = 0
DisplayedMnemonicIndex = 0
end
object jLPunkte1: TJLabel
Tag = 1
Left = 11
Top = 48
Width = 166
Height = 33
Hint = 'jLabel3'
Foreground = clMaroon
Background = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clMaroon
Font.Height = -24
Font.Name = 'Dialog'
Font.Style = [fsBold]
Text = '0 Punkte'
HorizontalAlignment = LEFT
VerticalAlignment = CENTER
HorizontalTextPosition = CENTER
VerticalTextPosition = CENTER
IconTextGap = 4
DisplayedMnemonic = 0
DisplayedMnemonicIndex = 0
end
end
object jPSpieler2: TJPanel
Tag = 12
Left = 832
Top = 160
Width = 185
Height = 89
Hint = 'jPanel5'
Foreground = 3355443
Background = 15658734
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Dialog'
Font.Style = [fsBold]
Border.BorderType = BevelBorder
Border.LineColor = clBlack
Border.LineThickness = 0
Border.LineRounded = False
Border.EtchHighlightColor = clBlack
Border.EtchShadowColor = clBlack
Border.Etchtype = 0
Border.BevelHighlightColor = clWhite
Border.BevelShadowColor = clBlack
Border.Beveltype = 1
Border.MatteColor = clBlack
Border.MatteTop = 0
Border.MatteLeft = 0
Border.MatteBottom = 0
Border.MatteRight = 0
object jLName2: TJLabel
Tag = 1
Left = 8
Top = 8
Width = 174
Height = 33
Hint = 'jLabel3'
Foreground = clNavy
Background = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clNavy
Font.Height = -24
Font.Name = 'Dialog'
Font.Style = [fsBold]
Text = 'Spieler 2'
HorizontalAlignment = LEFT
VerticalAlignment = CENTER
HorizontalTextPosition = CENTER
VerticalTextPosition = CENTER
IconTextGap = 4
DisplayedMnemonic = 0
DisplayedMnemonicIndex = 0
end
object jLPunkte2: TJLabel
Tag = 1
Left = 11
Top = 48
Width = 166
Height = 33
Hint = 'jLabel3'
Foreground = clMaroon
Background = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clMaroon
Font.Height = -24
Font.Name = 'Dialog'
Font.Style = [fsBold]
Text = '0 Punkte'
HorizontalAlignment = LEFT
VerticalAlignment = CENTER
HorizontalTextPosition = CENTER
VerticalTextPosition = CENTER
IconTextGap = 4
DisplayedMnemonic = 0
DisplayedMnemonicIndex = 0
end
end
object jPSpieler3: TJPanel
Tag = 12
Left = 832
Top = 248
Width = 185
Height = 89
Hint = 'jPanel5'
Foreground = 3355443
Background = 15658734
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Dialog'
Font.Style = [fsBold]
Border.BorderType = BevelBorder
Border.LineColor = clBlack
Border.LineThickness = 0
Border.LineRounded = False
Border.EtchHighlightColor = clBlack
Border.EtchShadowColor = clBlack
Border.Etchtype = 0
Border.BevelHighlightColor = clWhite
Border.BevelShadowColor = clBlack
Border.Beveltype = 1
Border.MatteColor = clBlack
Border.MatteTop = 0
Border.MatteLeft = 0
Border.MatteBottom = 0
Border.MatteRight = 0
object jLName3: TJLabel
Tag = 1
Left = 8
Top = 8
Width = 174
Height = 33
Hint = 'jLabel3'
Foreground = clNavy
Background = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clNavy
Font.Height = -24
Font.Name = 'Dialog'
Font.Style = [fsBold]
Text = 'Spieler 3'
HorizontalAlignment = LEFT
VerticalAlignment = CENTER
HorizontalTextPosition = CENTER
VerticalTextPosition = CENTER
IconTextGap = 4
DisplayedMnemonic = 0
DisplayedMnemonicIndex = 0
end
object jLPunkte3: TJLabel
Tag = 1
Left = 11
Top = 48
Width = 166
Height = 33
Hint = 'jLabel3'
Foreground = clMaroon
Background = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clMaroon
Font.Height = -24
Font.Name = 'Dialog'
Font.Style = [fsBold]
Text = '0 Punkte'
HorizontalAlignment = LEFT
VerticalAlignment = CENTER
HorizontalTextPosition = CENTER
VerticalTextPosition = CENTER
IconTextGap = 4
DisplayedMnemonic = 0
DisplayedMnemonicIndex = 0
end
end
object jPSpieler4: TJPanel
Tag = 12
Left = 832
Top = 336
Width = 185
Height = 89
Hint = 'jPanel5'
Foreground = 3355443
Background = 15658734
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Dialog'
Font.Style = [fsBold]
Border.BorderType = BevelBorder
Border.LineColor = clBlack
Border.LineThickness = 0
Border.LineRounded = False
Border.EtchHighlightColor = clBlack
Border.EtchShadowColor = clBlack
Border.Etchtype = 0
Border.BevelHighlightColor = clWhite
Border.BevelShadowColor = clBlack
Border.Beveltype = 1
Border.MatteColor = clBlack
Border.MatteTop = 0
Border.MatteLeft = 0
Border.MatteBottom = 0
Border.MatteRight = 0
object jLName4: TJLabel
Tag = 1
Left = 8
Top = 8
Width = 174
Height = 33
Hint = 'jLabel3'
Foreground = clNavy
Background = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clNavy
Font.Height = -24
Font.Name = 'Dialog'
Font.Style = [fsBold]
Text = 'Spieler 4'
HorizontalAlignment = LEFT
VerticalAlignment = CENTER
HorizontalTextPosition = CENTER
VerticalTextPosition = CENTER
IconTextGap = 4
DisplayedMnemonic = 0
DisplayedMnemonicIndex = 0
end
object jLPunkte4: TJLabel
Tag = 1
Left = 11
Top = 48
Width = 166
Height = 33
Hint = 'jLabel3'
Foreground = clMaroon
Background = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clMaroon
Font.Height = -24
Font.Name = 'Dialog'
Font.Style = [fsBold]
Text = '0 Punkte'
HorizontalAlignment = LEFT
VerticalAlignment = CENTER
HorizontalTextPosition = CENTER
VerticalTextPosition = CENTER
IconTextGap = 4
DisplayedMnemonic = 0
DisplayedMnemonicIndex = 0
end
end
object jButton3: TJButton
Tag = 4
Left = 2
Top = 215
Width = 193
Height = 65
Hint = 'jButton2'
Foreground = clWindowText
Background = 15658734
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -36
Font.Name = 'Dialog'
Font.Style = [fsBold]
actionPerformed = 'jButton3_ActionPerformed'
Text = '40'
Mnemonic = 0
DisplayedMnemonicIndex = 0
Selected = False
BorderPainted = True
FocusPainted = False
ContentAreaFilled = True
HorizontalAlignment = CENTER
VerticalAlignment = CENTER
HorizontalTextPosition = RIGHT
VerticalTextPosition = CENTER
IconTextGap = 4
RolloverEnabled = False
Border.BorderType = NoBorder
Border.LineColor = clBlack
Border.LineThickness = 0
Border.LineRounded = False
Border.EtchHighlightColor = clBlack
Border.EtchShadowColor = clBlack
Border.Etchtype = 0
Border.BevelHighlightColor = clBlack
Border.BevelShadowColor = clBlack
Border.Beveltype = 0
Border.MatteColor = clBlack
Border.MatteTop = 0
Border.MatteLeft = 0
Border.MatteBottom = 0
Border.MatteRight = 0
end
object jButton4: TJButton
Tag = 4
Left = 2
Top = 343
Width = 193
Height = 65
Hint = 'jButton2'
Foreground = clWindowText
Background = 15658734
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -36
Font.Name = 'Dialog'
Font.Style = [fsBold]
actionPerformed = 'jButton4_ActionPerformed'
Text = '80'
Mnemonic = 0
DisplayedMnemonicIndex = 0
Selected = False
BorderPainted = True
FocusPainted = False
ContentAreaFilled = True
HorizontalAlignment = CENTER
VerticalAlignment = CENTER
HorizontalTextPosition = RIGHT
VerticalTextPosition = CENTER
IconTextGap = 4
RolloverEnabled = False
Border.BorderType = NoBorder
Border.LineColor = clBlack
Border.LineThickness = 0
Border.LineRounded = False
Border.EtchHighlightColor = clBlack
Border.EtchShadowColor = clBlack
Border.Etchtype = 0
Border.BevelHighlightColor = clBlack
Border.BevelShadowColor = clBlack
Border.Beveltype = 0
Border.MatteColor = clBlack
Border.MatteTop = 0
Border.MatteLeft = 0
Border.MatteBottom = 0
Border.MatteRight = 0
end
object jButton5: TJButton
Tag = 4
Left = 2
Top = 407
Width = 193
Height = 65
Hint = 'jButton2'
Foreground = clWindowText
Background = 15658734
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -36
Font.Name = 'Dialog'
Font.Style = [fsBold]
actionPerformed = 'jButton5_ActionPerformed'
Text = '100'
Mnemonic = 0
DisplayedMnemonicIndex = 0
Selected = False
BorderPainted = True
FocusPainted = False
ContentAreaFilled = True
HorizontalAlignment = CENTER
VerticalAlignment = CENTER
HorizontalTextPosition = RIGHT
VerticalTextPosition = CENTER
IconTextGap = 4
RolloverEnabled = False
Border.BorderType = NoBorder
Border.LineColor = clBlack
Border.LineThickness = 0
Border.LineRounded = False
Border.EtchHighlightColor = clBlack
Border.EtchShadowColor = clBlack
Border.Etchtype = 0
Border.BevelHighlightColor = clBlack
Border.BevelShadowColor = clBlack
Border.Beveltype = 0
Border.MatteColor = clBlack
Border.MatteTop = 0
Border.MatteLeft = 0
Border.MatteBottom = 0
Border.MatteRight = 0
end
object jBEnde: TJButton
Tag = 4
Left = 832
Top = 432
Width = 185
Height = 49
Hint = 'jButton6'
Foreground = clWindowText
Background = 15658734
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -24
Font.Name = 'Dialog'
Font.Style = [fsBold]
actionPerformed = 'jBEnde_ActionPerformed'
Text = 'Spiel beenden'
Mnemonic = 0
DisplayedMnemonicIndex = 0
Selected = False
BorderPainted = True
FocusPainted = False
ContentAreaFilled = True
HorizontalAlignment = CENTER
VerticalAlignment = CENTER
HorizontalTextPosition = RIGHT
VerticalTextPosition = CENTER
IconTextGap = 4
RolloverEnabled = False
Border.BorderType = NoBorder
Border.LineColor = clBlack
Border.LineThickness = 0
Border.LineRounded = False
Border.EtchHighlightColor = clBlack
Border.EtchShadowColor = clBlack
Border.Etchtype = 0
Border.BevelHighlightColor = clBlack
Border.BevelShadowColor = clBlack
Border.Beveltype = 0
Border.MatteColor = clBlack
Border.MatteTop = 0
Border.MatteLeft = 0
Border.MatteBottom = 0
Border.MatteRight = 0
end
end
object jPanel1: TJPanel
Tag = 12
Left = 2
Top = 85
Width = 193
Height = 65
Hint = 'jPanel1'
Foreground = 3355443
Background = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Dialog'
Font.Style = [fsBold]
Border.BorderType = BevelBorder
Border.LineColor = clBlack
Border.LineThickness = 0
Border.LineRounded = False
Border.EtchHighlightColor = clWhite
Border.EtchShadowColor = clBlack
Border.Etchtype = 0
Border.BevelHighlightColor = clWhite
Border.BevelShadowColor = clBlack
Border.Beveltype = 0
Border.MatteColor = clBlack
Border.MatteTop = 0
Border.MatteLeft = 0
Border.MatteBottom = 0
Border.MatteRight = 0
object jLabel2: TJLabel
Tag = 1
Left = 8
Top = 8
Width = 174
Height = 44
Hint = 'jLabel2'
Foreground = clWindowText
Background = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -24
Font.Name = 'Dialog'
Font.Style = [fsBold]
Text = 'Router'
HorizontalAlignment = CENTER
VerticalAlignment = CENTER
HorizontalTextPosition = RIGHT
VerticalTextPosition = CENTER
IconTextGap = 4
DisplayedMnemonic = 0
DisplayedMnemonicIndex = 0
end
end
object jLStatus: TJLabel
Tag = 1
Left = 8
Top = 488
Width = 1011
Height = 57
Hint = 'jLabel3'
Foreground = clWhite
Background = clGray
Font.Charset = DEFAULT_CHARSET
Font.Color = clWhite
Font.Height = -24
Font.Name = 'Dialog'
Font.Style = [fsBold]
Text = 'W'#228'hle bitte eine Frage...'
HorizontalAlignment = LEFT
VerticalAlignment = CENTER
HorizontalTextPosition = RIGHT
VerticalTextPosition = CENTER
IconTextGap = 4
DisplayedMnemonic = 0
DisplayedMnemonicIndex = 0
end
object jButton1: TJButton
Tag = 4
Left = 2
Top = 150
Width = 193
Height = 65
Hint = 'jButton1'
Foreground = clWindowText
Background = 15658734
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -36
Font.Name = 'Dialog'
Font.Style = [fsBold]
actionPerformed = 'jButton1_ActionPerformed'
Text = '20'
Mnemonic = 0
DisplayedMnemonicIndex = 0
Selected = False
BorderPainted = True
FocusPainted = False
ContentAreaFilled = True
HorizontalAlignment = CENTER
VerticalAlignment = CENTER
HorizontalTextPosition = RIGHT
VerticalTextPosition = CENTER
IconTextGap = 4
RolloverEnabled = False
Border.BorderType = NoBorder
Border.LineColor = clBlack
Border.LineThickness = 0
Border.LineRounded = False
Border.EtchHighlightColor = clBlack
Border.EtchShadowColor = clBlack
Border.Etchtype = 0
Border.BevelHighlightColor = clBlack
Border.BevelShadowColor = clBlack
Border.Beveltype = 0
Border.MatteColor = clBlack
Border.MatteTop = 0
Border.MatteLeft = 0
Border.MatteBottom = 0
Border.MatteRight = 0
end
object jButton2: TJButton
Tag = 4
Left = 2
Top = 279
Width = 193
Height = 65
Hint = 'jButton2'
Foreground = clWindowText
Background = 15658734
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -36
Font.Name = 'Dialog'
Font.Style = [fsBold]
actionPerformed = 'jButton2_ActionPerformed'
Text = '60'
Mnemonic = 0
DisplayedMnemonicIndex = 0
Selected = False
BorderPainted = True
FocusPainted = False
ContentAreaFilled = True
HorizontalAlignment = CENTER
VerticalAlignment = CENTER
HorizontalTextPosition = RIGHT
VerticalTextPosition = CENTER
IconTextGap = 4
RolloverEnabled = False
Border.BorderType = NoBorder
Border.LineColor = clBlack
Border.LineThickness = 0
Border.LineRounded = False
Border.EtchHighlightColor = clBlack
Border.EtchShadowColor = clBlack
Border.Etchtype = 0
Border.BevelHighlightColor = clBlack
Border.BevelShadowColor = clBlack
Border.Beveltype = 0
Border.MatteColor = clBlack
Border.MatteTop = 0
Border.MatteLeft = 0
Border.MatteBottom = 0
Border.MatteRight = 0
end
object jLabel1: TJLabel
Tag = 1
Left = 2
Top = 2
Width = 1019
Height = 65
Hint = 'jLabel1'
Foreground = 3355443
Background = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Dialog'
Font.Style = [fsBold]
Text = 'text'
Icon = 'images/Titelleiste_Netzwerk.png'
HorizontalAlignment = LEFT
VerticalAlignment = CENTER
HorizontalTextPosition = RIGHT
VerticalTextPosition = CENTER
IconTextGap = 4
DisplayedMnemonic = 0
DisplayedMnemonicIndex = 0
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

View file

@ -0,0 +1,195 @@
<?xml version="1.0" encoding="UTF-8"?>
<Quiz>
<Titel>Internet-Kommunikation</Titel>
<Kategorie name="Router">
<Frage>
<Punkte>20</Punkte>
<Frage>Was ist ein Router?</Frage>
<Antwort>Ein Gerät, um Daten im Internet weiterzuschicken.</Antwort>
<Antwort>Ein Verkehrszeichen in England</Antwort>
<Antwort>Ein Routenplaner fürs Auto</Antwort>
<Antwort>Ein besonders schnelles Datenpaket</Antwort>
<Richtig>1</Richtig>
</Frage>
<Frage>
<Punkte>40</Punkte>
<Frage>Kann man ohne Router mit dem Internet verbunden sein?</Frage>
<Antwort>Ja, wenn man WLAN hat.</Antwort>
<Antwort>Ja, mit einem Handy (LTE oder UTMS).</Antwort>
<Antwort>Das kommt darauf an.</Antwort>
<Antwort>Nein, die Kommunikation über das Internet geht immer über Router.</Antwort>
<Richtig>4</Richtig>
</Frage>
<Frage>
<Punkte>60</Punkte>
<Frage>Wie viele Netzwerkkabel führen zu einem Router?</Frage>
<Antwort>Gar keins.</Antwort>
<Antwort>Genau eins.</Antwort>
<Antwort>Mindestens zwei.</Antwort>
<Antwort>Maximal zwei.</Antwort>
<Richtig>3</Richtig>
</Frage>
<Frage>
<Punkte>80</Punkte>
<Frage>Was passiert, wenn ein Router ausfällt?</Frage>
<Antwort>Das ganze Internet bricht zusammen.</Antwort>
<Antwort>Ein Techniker wechselt in Minutenschnelle den Router aus und dann geht das Internet wieder.</Antwort>
<Antwort>Die anderen Router merken dies und schicken die Pakete auf einem anderen Weg.</Antwort>
<Antwort>Router können gar nicht kaputt gehen.</Antwort>
<Richtig>3</Richtig>
</Frage>
<Frage>
<Punkte>100</Punkte>
<Frage>Über wie viele Router läuft ein Datenpaket im Internet, wenn es einmal um die Welt geschickt wird?</Frage>
<Antwort>ca. 5</Antwort>
<Antwort>ca. 15</Antwort>
<Antwort>ca. 150</Antwort>
<Antwort>ca. 1500</Antwort>
<Richtig>2</Richtig>
</Frage>
</Kategorie>
<Kategorie name="Client-Server">
<Frage>
<Punkte>20</Punkte>
<Frage>Welche Aussage über einen Server stimmt nicht?</Frage>
<Antwort>Ein Server ist ein Computerprogramm, das Anfragen beantwortet.</Antwort>
<Antwort>Ein Server ist die meiste Zeit mit Warten beschäfftigt.</Antwort>
<Antwort>Ein Server ist ein Roboter zum Bedienen.</Antwort>
<Antwort>Server ist englisch und bedeutet Diener/Bedienung.</Antwort>
<Richtig>3</Richtig>
</Frage>
<Frage>
<Punkte>40</Punkte>
<Frage>Wer speichert die noch nicht ausgelieferten WhatsApp Nachrichten?</Frage>
<Antwort>Der Server von WhatsApp.</Antwort>
<Antwort>Sie bewegen sich im Internet umher, bis sie zugestellt werden.</Antwort>
<Antwort>Das Handy des Empfängers speichert sie, auch wenn es nicht online ist.</Antwort>
<Antwort>Das Handy des Absenders wartet bis der Empfänge online ist und schickt sie dann.</Antwort>
<Richtig>1</Richtig>
</Frage>
<Frage>
<Punkte>60</Punkte>
<Frage>Was ist keine Client-Server-Anwendung?</Frage>
<Antwort>Emailversand</Antwort>
<Antwort>Online-Computerspiel (z.B. Clash of clans)</Antwort>
<Antwort>World Wide Web (WWW)</Antwort>
<Antwort>Textverarbeitungsprogramm</Antwort>
<Richtig>4</Richtig>
</Frage>
<Frage>
<Punkte>80</Punkte>
<Frage>"Ein Filesharing-Programm (z.B. Bittorrent) ist sowohl Client wie auch Server".</Frage>
<Antwort>Die Aussage stimmt, da man sowohl Dateien abrufen kann (Client-Funktion), als auch gleichzeitig eigene Dateien anbietet (Server-Funktion).</Antwort>
<Antwort>Die Aussage stimmt, da man sowohl Dateien abrufen kann (Server-Funktion), als auch gleichzeitig eigene Dateien anbietet (Client-Funktion).</Antwort>
<Antwort>Die Aussage stimmt nicht, da kein Programm gleichzeitig Client und Server sein kann.</Antwort>
<Antwort>Die Aussage stimmt nicht, da es sich hier überhaupt nicht um eine Client-Server-Anwendung handelt.</Antwort>
<Richtig>1</Richtig>
</Frage>
<Frage>
<Punkte>100</Punkte>
<Frage>Kann dein Computer zu Hause ein Server sein?</Frage>
<Antwort>Ja, ich muss dazu aber ein bestimmtes Programm starten.</Antwort>
<Antwort>Ja, jeder Computer, der im Internet ist, ist auch ein Server.</Antwort>
<Antwort>Nein, Server können nur spezielle Computer sein.</Antwort>
<Antwort>Nein, Server darf man als Privatperson nicht betreiben.</Antwort>
<Richtig>1</Richtig>
</Frage>
</Kategorie>
<Kategorie name="Datenspeicher">
<Frage>
<Punkte>20</Punkte>
<Frage>Wo kann man keine Dateien speichern?</Frage>
<Antwort>In der Cloud (=Server im Internet) </Antwort>
<Antwort>In einem Silo.</Antwort>
<Antwort>Auf der lokalen Festplatte</Antwort>
<Antwort>Auf dem Schulserver</Antwort>
<Richtig>2</Richtig>
</Frage>
<Frage>
<Punkte>40</Punkte>
<Frage>Bei welchem Speichermedium hat man den schnellsten Zugriff?</Frage>
<Antwort>USB-Stick.</Antwort>
<Antwort>Cloud-Speicher</Antwort>
<Antwort>lokale Festplatte (SSD)</Antwort>
<Antwort>auf dem Schulserver</Antwort>
<Richtig>3</Richtig>
</Frage>
<Frage>
<Punkte>60</Punkte>
<Frage>Welche Aussage über Cloud-Speicher stimmt nicht?</Frage>
<Antwort>Die Daten werden vor der Speicherung über das Internet übertragen.</Antwort>
<Antwort>Die Daten sind von jedem an das Internet angeschlossene Rechner abrufbar.</Antwort>
<Antwort>Die Daten werden durch das Internet geschickt, bis sie wieder abgerufen werden.</Antwort>
<Antwort>Die Daten werden von einer kommerziellen Firma für den Anwender gespeichert.</Antwort>
<Richtig>3</Richtig>
</Frage>
<Frage>
<Punkte>80</Punkte>
<Frage>Welche Aussage über das Homeverzeichnis in der Schule stimmt nicht?</Frage>
<Antwort>Auf jedem Computer der Schule hat man Zugriff auf sein Homeverzeichnis.</Antwort>
<Antwort>Das Homeverzeichnis wird auf einem zentralen Server gespeichert.</Antwort>
<Antwort>Der Zugriff auf fremde Homeverzeichnisse ist durch ein Passwort geschützt.</Antwort>
<Antwort>Niemand kann auf die Daten in meinem Homeverzeichnis zugreifen. </Antwort>
<Richtig>4</Richtig>
</Frage>
<Frage>
<Punkte>100</Punkte>
<Frage>Wie groß ist der Datenspeicher der NSA (Amerikanischer Geheimdienst)?</Frage>
<Antwort>10 Gigabyte </Antwort>
<Antwort>10 Terabyte (10.000 GByte)</Antwort>
<Antwort>10 Petabyte (10.000.000 GByte)</Antwort>
<Antwort>10 Exabyte (10.000.000.000 GByte)</Antwort>
<Richtig>4</Richtig>
</Frage>
</Kategorie>
<Kategorie name="Internet">
<Frage>
<Punkte>20</Punkte>
<Frage>Was bedeutet Internet wörtlich übersetzt?</Frage>
<Antwort>Zwischennetz (von inter=lateinisch "zwischen", net=englisch "Netz")</Antwort>
<Antwort>Geheimnis (von intern (lateinisch)= nur in der Gruppe von Bedeutung)</Antwort>
<Antwort>Netz unter der Erde (von in terra (lateinisch) = "in der Erde", net=englisch "Netz")</Antwort>
<Antwort>Teilnehmernetz (von interesse (lateinisch) = "dabei sein")</Antwort>
<Richtig>1</Richtig>
</Frage>
<Frage>
<Punkte>40</Punkte>
<Frage>Seit wann gibt es das ARPA-Net, den Vorläufer des Internets?</Frage>
<Antwort>1921</Antwort>
<Antwort>1968</Antwort>
<Antwort>1992</Antwort>
<Antwort>2002</Antwort>
<Richtig>2</Richtig>
</Frage>
<Frage>
<Punkte>60</Punkte>
<Frage>Wie viele Geräte sind 2014 an das Internet angeschlossen gewesen?</Frage>
<Antwort>ca. 50.000</Antwort>
<Antwort>ca. 6.000.000</Antwort>
<Antwort>ca. 800.000.000</Antwort>
<Antwort>ca. 9.000.000.000</Antwort>
<Richtig>4</Richtig>
</Frage>
<Frage>
<Punkte>80</Punkte>
<Frage>Wann wurde das erste Youtube-Video hochgeladen?</Frage>
<Antwort>1982</Antwort>
<Antwort>1995</Antwort>
<Antwort>2004</Antwort>
<Antwort>2009</Antwort>
<Richtig>3</Richtig>
</Frage>
<Frage>
<Punkte>100</Punkte>
<Frage>Wie viele Textseiten lassen sich pro Sekunde auf schnellen Internet-Datenleitungen (10 GBit/s) übertragen?</Frage>
<Antwort>ca. 9.000</Antwort>
<Antwort>ca. 700.000</Antwort>
<Antwort>ca. 20.000.000</Antwort>
<Antwort>ca. 1.500.000.000</Antwort>
<Richtig>2</Richtig>
</Frage>
</Kategorie>
</Quiz>

View file

@ -0,0 +1,12 @@
= Material : Spiel "Der große Preis"
|===
|Zuordnung| Sonstiges
|Klassenstufe| beliebig
|Bildungsplanbezug | beliebeig
|Werkzeug| Java
|Autoren| Thomas Schaller
|===
== Inhalt
Mit diesem Programm kann "Der große Preis" mit bis zu vier Schülergruppen gespielt werden. Die Fragen werden in einer XML-Datei hinterlegt und können beliebig ausgetauscht werden.