mirror of
https://github.com/jokerx3/HeatUp
synced 2026-07-27 11:29:46 +02:00
ActionControl Anpassungen
This commit is contained in:
@@ -8,41 +8,41 @@ import javax.swing.*;
|
|||||||
import javax.swing.border.LineBorder;
|
import javax.swing.border.LineBorder;
|
||||||
|
|
||||||
public class ActionControl {
|
public class ActionControl {
|
||||||
private Smashing smashing;
|
private static Smashing smashing;
|
||||||
private Keysequence keysequence;
|
private static Keysequence keysequence;
|
||||||
private JPanel panel;
|
private static JPanel panel;
|
||||||
private JLabel comp;
|
private static JLabel comp;
|
||||||
|
|
||||||
public void setPanel(JPanel newPanel){
|
public static void setPanel(JPanel newPanel){
|
||||||
panel = newPanel;
|
panel = newPanel;
|
||||||
|
smashing = new Smashing();
|
||||||
|
keysequence = new Keysequence();
|
||||||
|
comp = new JLabel();
|
||||||
|
panel.add(comp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAction(String s){
|
public static void setAction(String s){
|
||||||
|
System.out.println("prompt");
|
||||||
if(s.equals("smashing")){
|
if(s.equals("smashing")){
|
||||||
smashing = new Smashing();
|
String str= "Bitte die Taste "+smashing.getKey()+" so schnell wie möglich drücken";
|
||||||
String tmp= "Bitte die Taste "+smashing.getKey()+" so schnell wie möglich drücken";
|
comp.setText(str);
|
||||||
comp = new JLabel(tmp);
|
|
||||||
comp.setFont(new Font("Arial", Font.CENTER_BASELINE, 16));
|
comp.setFont(new Font("Arial", Font.CENTER_BASELINE, 16));
|
||||||
comp.setBorder(new LineBorder(Color.BLACK, 1));
|
comp.setBorder(new LineBorder(Color.BLACK, 1));
|
||||||
comp.setSize(100,10);
|
comp.setSize(100,10);
|
||||||
panel.add(comp);
|
|
||||||
panel.setVisible(false);
|
panel.setVisible(false);
|
||||||
panel.setVisible(true);
|
panel.setVisible(true);
|
||||||
}else{
|
}else{
|
||||||
keysequence = new Keysequence();
|
char []tmp = keysequence.getKeySequence();
|
||||||
String tmp="Bitte diese Tastenkombination "+keysequence.getKeySequence()[0]+" "+keysequence.getKeySequence()[1]+" "+keysequence.getKeySequence()[2]+" "+keysequence.getKeySequence()[3]+" "+" so schnell wie möglich drücken";
|
String str="Bitte diese Tastenkombination \""+tmp[0]+" "+tmp[1]+" "+tmp[2]+" "+tmp[3]+"\" "+"so schnell wie möglich eingeben";
|
||||||
comp = new JLabel(tmp);
|
comp.setText(str);
|
||||||
comp.setFont(new Font("Arial", Font.CENTER_BASELINE, 16));
|
comp.setFont(new Font("Arial", Font.CENTER_BASELINE, 16));
|
||||||
comp.setBorder(new LineBorder(Color.BLACK, 1));
|
comp.setBorder(new LineBorder(Color.BLACK, 1));
|
||||||
comp.setSize(100,10);
|
comp.setSize(100,10);
|
||||||
panel.add(comp);
|
|
||||||
panel.setVisible(false);
|
panel.setVisible(false);
|
||||||
panel.setVisible(true);
|
panel.setVisible(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void wishPanel(){
|
public static void wishPanel(){
|
||||||
comp.setVisible(false);
|
comp.setText("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user