def complex_console(): global frame #generates frame frame = JFrame("[BETA] Game Master\'s Bot - Console Log") frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE) frame.setResizable(False) frame.setAlwaysOnTop(True) frame.setBounds(8,545,600,130) frame.contentPane.layout = FlowLayout() #add QUIT button quitButton = JButton("QUIT", actionPerformed = closeFrame) quitButton.setForeground(Color.RED) quitButton.setPreferredSize(Dimension(100,100)) frame.contentPane.add(quitButton) #add text message global textArea textArea = JTextArea(6,38) textArea.setEditable(False) frame.contentPane.add(textArea) scrollPane = JScrollPane(textArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED) frame.contentPane.add(scrollPane) #show frame frame.pack() frame.setVisible(True) log("Welcome to Game Master\'s Bot!")
def simple_console(): global frame frame = JFrame("[BETA] GameMaster Bot - Log") frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE) frame.setBounds(0,45,560,30) global messageLOG messageLOG = JLabel("") frame.add(messageLOG,BorderLayout.CENTER) button = JButton("QUIT", actionPerformed =closeFrame) button.setForeground(Color.RED) frame.add(button,BorderLayout.WEST) frame.setUndecorated(True) frame.setAlwaysOnTop(True) frame.setVisible(True) log("Welcome to GameMaster\'s Bot!")
def create_gui(): global dropdown, current_file frame = JFrame('', defaultCloseOperation = JFrame.DISPOSE_ON_CLOSE, size = (400, 150)); frame.setBounds(350,350,400,150); container_panel = JPanel(GridBagLayout()); c = GridBagConstraints(); dropdown = JComboBox(list(img_paths.keys())); c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 0; c.gridy = 0; c.weightx = 0.5; c.gridwidth = 3; container_panel.add(dropdown, c); add_file_button = JButton('<html>Add Image/File</html>', actionPerformed=select_file); c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 3; c.gridy = 0; c.weightx = 0.5; c.gridwidth = 1; container_panel.add(add_file_button, c); process_file_button = JButton('<html>Process Selected Image</html>', actionPerformed=process_current_img); c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 0; c.gridy = 1; c.weightx = 0.5; c.gridwidth = 2; container_panel.add(process_file_button, c); process_all_button = JButton('<html>Process Entire Stack</html>', actionPerformed=process_stack); c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 2; c.gridy = 1; c.weightx = 0.5; c.gridwidth = 2; container_panel.add(process_all_button, c); current_file = dropdown.getSelectedItem(); frame.add(container_panel); frame.visible = True;
def addDetails(self): jf0 = JFrame() jf0.setTitle("Add Issue"); jf0.setLayout(None); txtEnterIssue = JTextField(); txtEnterIssue.setName("Enter Issue Name"); txtEnterIssue.setToolTipText("Enter Issue Name Here"); txtEnterIssue.setBounds(182, 58, 473, 40); jf0.add(txtEnterIssue); txtEnterIssue.setColumns(10); btnNewButton = JButton("Add"); btnNewButton.setBounds(322, 178, 139, 41); jf0.add(btnNewButton); comboBox = JComboBox(); comboBox.setMaximumRowCount(20); comboBox.setEditable(True); comboBox.setToolTipText("Objective Name"); comboBox.setBounds(182, 125, 473, 40); jf0.add(comboBox); lblNewLabel = JLabel("Issue Name Here"); lblNewLabel.setFont(Font("Tahoma", Font.PLAIN, 16)); lblNewLabel.setBounds(25, 58, 130, 40); jf0.add(lblNewLabel); lblNewLabel_1 = JLabel("Objective Name"); lblNewLabel_1.setFont(Font("Tahoma", Font.PLAIN, 16)); lblNewLabel_1.setBounds(25, 125, 130, 40); jf0.add(lblNewLabel_1); jf0.setVisible(True) jf0.setBounds(400, 300, 700, 300) jf0.EXIT_ON_CLOSE txtEnterIssue.addKeyListener(self)