- Joined
- Jul 11, 2020
- Messages
- 0
- Reaction score
- 26
- Points
- 0
Hallo ich habe ein externes Gui und ich möchte das Module Gui darauf ausblenden Hier ist der Code:
public class externalGui extends JFrame {
private Color titleColor = new Color(0xFFFFFF);
private Color bannerColor = new Color(0x16a085);
private Color lblColor = new Color(0x000000);
private Color txtColor = new Color(0x000033);
private Color btnColor = new Color(0x000033);
private Color bindColor = new Color(0x000000);
private JPanel contentPane;
private String name = Main.Client_NAME;
public static ArrayList<JButton> btnList = new ArrayList<JButton>();
public static ArrayList<JTextField> txtList = new ArrayList<JTextField>();
public externalGui() {
setResizable(false);
final File f = Main.saveFile;
setTitle(name);
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
int modules = Main.moduleManager.modules.size();
int size = (modules + 2) * 35;
int y = 45;
setBounds(100, 100, 320, size);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
contentPane.setLayout(null);
JPanel panel = new JPanel();
panel.setBackground(bannerColor);
panel.setBounds(0, 0, 320, 36);
this.contentPane.add(panel);
panel.setLayout(null);
JLabel title = new JLabel(name + " Gui");
title.setForeground(titleColor);
title.setFont(new Font("Futura", Font.PLAIN, 24));
title.setBounds(10, 5, 240, 25);
panel.add(title);
for (final Module m : Main.moduleManager.modules) {
JLabel lbl = new JLabel(m.getName() + ":");
lbl.setForeground(lblColor);
lbl.setBounds(10, y, 100, 23);
contentPane.add(lbl);
final JButton btn = new JButton("false");
btn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Main.moduleManager.getModule(m.getClass()).toggleModule();
btn.setText(Boolean.toString(Main.moduleManager.getModule(m.getClass()).getState()));
}
});
btn.setForeground(txtColor);
btn.setBackground(btnColor);
btn.setBounds(120, y, 99, 23);
btnList.add(btn);
contentPane.add(btn);
y = y + 35;
}
}
}
private Color titleColor = new Color(0xFFFFFF);
private Color bannerColor = new Color(0x16a085);
private Color lblColor = new Color(0x000000);
private Color txtColor = new Color(0x000033);
private Color btnColor = new Color(0x000033);
private Color bindColor = new Color(0x000000);
private JPanel contentPane;
private String name = Main.Client_NAME;
public static ArrayList<JButton> btnList = new ArrayList<JButton>();
public static ArrayList<JTextField> txtList = new ArrayList<JTextField>();
public externalGui() {
setResizable(false);
final File f = Main.saveFile;
setTitle(name);
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
int modules = Main.moduleManager.modules.size();
int size = (modules + 2) * 35;
int y = 45;
setBounds(100, 100, 320, size);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
contentPane.setLayout(null);
JPanel panel = new JPanel();
panel.setBackground(bannerColor);
panel.setBounds(0, 0, 320, 36);
this.contentPane.add(panel);
panel.setLayout(null);
JLabel title = new JLabel(name + " Gui");
title.setForeground(titleColor);
title.setFont(new Font("Futura", Font.PLAIN, 24));
title.setBounds(10, 5, 240, 25);
panel.add(title);
for (final Module m : Main.moduleManager.modules) {
JLabel lbl = new JLabel(m.getName() + ":");
lbl.setForeground(lblColor);
lbl.setBounds(10, y, 100, 23);
contentPane.add(lbl);
final JButton btn = new JButton("false");
btn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Main.moduleManager.getModule(m.getClass()).toggleModule();
btn.setText(Boolean.toString(Main.moduleManager.getModule(m.getClass()).getState()));
}
});
btn.setForeground(txtColor);
btn.setBackground(btnColor);
btn.setBounds(120, y, 99, 23);
btnList.add(btn);
contentPane.add(btn);
y = y + 35;
}
}
}
Last edited by a moderator: