Note that there are some explanatory texts on larger screens.

plurals
  1. POOpening a jFrame from another via button click
    primarykey
    data
    text
    <p>I understand that this has be gone over many many times and I've been googling this for hours but for some reason I cant get this working. Please take it easy on me...I'm a noob to java, I'm a vb.net boy. Thanks For The Help</p> <p>Here is my button listener code from my calling page. I get an error of </p> <pre><code>Method setvisable(boolean) is unidentified for the type Pay_Types </code></pre> <hr> <pre><code>private class BtnEditPayActionListener implements ActionListener { public void actionPerformed(ActionEvent arg0) { Pay_Types p = new Pay_Types(); p.setvisable(true); } } </code></pre> <p>I have also tried this listener. Same Error here</p> <pre><code>private class BtnEditPayMouseListener extends MouseAdapter { @Override public void mouseClicked(MouseEvent e) { Pay_Types p = new Pay_Types(); p.setvisable(true); } } </code></pre> <p>Here is my code for Pay_Types.java.</p> <pre><code>package com.dooleyfam.bep1; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JCheckBox; import java.awt.BorderLayout; import java.awt.FlowLayout; import javax.swing.JPanel; import javax.swing.border.TitledBorder; import javax.swing.JTextField; import javax.swing.JLabel; import javax.swing.JButton; public class Pay_Types { private JFrame frame; private JCheckBox chckbxEmpty; private JCheckBox chckbxPerLoadedMile; private JCheckBox chckbxHourly; private JCheckBox chckbxOvertime; private JPanel panel; private JPanel panel_1; private JPanel panel_2; private JCheckBox chckbxPerMile; private JCheckBox chckbxPerDay; private JCheckBox chckbxOther; private JPanel panel_3; private JCheckBox chckbxPerCwthundred; private JCheckBox chckbxPercentageOf; private JCheckBox chckbxOther_1; private JTextField textField; private JTextField textField_1; private JTextField textField_3; private JTextField textField_4; private JTextField textField_6; private JTextField textField_7; private JTextField textField_8; private JTextField textField_9; private JLabel lblDenotesThat; private JButton btnCancel; private JButton btnOk; /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { Pay_Types window = new Pay_Types(); window.frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the application. */ public Pay_Types() { initialize(); } /** * Initialize the contents of the frame. */ private void initialize() { frame = new JFrame(); frame.setBounds(100, 100, 503, 285); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().setLayout(null); panel = new JPanel(); panel.setBorder(new TitledBorder(null, "Per Mile", TitledBorder.LEADING, TitledBorder.TOP, null, null)); panel.setBounds(6, 11, 166, 97); frame.getContentPane().add(panel); panel.setLayout(null); chckbxEmpty = new JCheckBox("Empty"); chckbxEmpty.setBounds(102, 15, 55, 23); panel.add(chckbxEmpty); chckbxPerLoadedMile = new JCheckBox("Loaded"); chckbxPerLoadedMile.setBounds(102, 41, 61, 23); panel.add(chckbxPerLoadedMile); chckbxOther = new JCheckBox("Other*"); chckbxOther.setBounds(102, 67, 61, 23); panel.add(chckbxOther); textField_3 = new JTextField(); textField_3.setBounds(10, 16, 86, 20); panel.add(textField_3); textField_3.setColumns(10); textField_4 = new JTextField(); textField_4.setBounds(10, 42, 86, 20); panel.add(textField_4); textField_4.setColumns(10); panel_1 = new JPanel(); panel_1.setBorder(new TitledBorder(null, "Hourly", TitledBorder.LEADING, TitledBorder.TOP, null, null)); panel_1.setBounds(182, 11, 297, 71); frame.getContentPane().add(panel_1); panel_1.setLayout(null); chckbxOvertime = new JCheckBox("Overtime"); chckbxOvertime.setBounds(102, 40, 86, 23); panel_1.add(chckbxOvertime); chckbxHourly = new JCheckBox("Regular"); chckbxHourly.setBounds(102, 14, 68, 23); panel_1.add(chckbxHourly); textField_6 = new JTextField(); textField_6.setBounds(10, 15, 86, 20); panel_1.add(textField_6); textField_6.setColumns(10); textField_7 = new JTextField(); textField_7.setBounds(10, 41, 86, 20); panel_1.add(textField_7); textField_7.setColumns(10); panel_2 = new JPanel(); panel_2.setBorder(new TitledBorder(null, "Per Diem", TitledBorder.LEADING, TitledBorder.TOP, null, null)); panel_2.setBounds(0, 108, 172, 71); frame.getContentPane().add(panel_2); panel_2.setLayout(null); chckbxPerMile = new JCheckBox("Per Mile"); chckbxPerMile.setBounds(102, 14, 63, 23); panel_2.add(chckbxPerMile); chckbxPerDay = new JCheckBox("Per Day"); chckbxPerDay.setBounds(102, 40, 63, 23); panel_2.add(chckbxPerDay); textField_8 = new JTextField(); textField_8.setBounds(10, 15, 86, 20); panel_2.add(textField_8); textField_8.setColumns(10); textField_9 = new JTextField(); textField_9.setBounds(10, 42, 86, 20); panel_2.add(textField_9); textField_9.setColumns(10); panel_3 = new JPanel(); panel_3.setBorder(new TitledBorder(null, "Other", TitledBorder.LEADING, TitledBorder.TOP, null, null)); panel_3.setBounds(182, 82, 297, 97); frame.getContentPane().add(panel_3); panel_3.setLayout(null); chckbxPerCwthundred = new JCheckBox("Per Hundred Weight (CWT)"); chckbxPerCwthundred.setBounds(102, 14, 157, 23); panel_3.add(chckbxPerCwthundred); chckbxPercentageOf = new JCheckBox("Percentage of Line Haul (PLH)"); chckbxPercentageOf.setBounds(102, 41, 169, 23); panel_3.add(chckbxPercentageOf); chckbxOther_1 = new JCheckBox("Other (Flat Rate, Percentage) *"); chckbxOther_1.setBounds(102, 68, 189, 23); panel_3.add(chckbxOther_1); textField = new JTextField(); textField.setBounds(10, 15, 86, 20); panel_3.add(textField); textField.setColumns(10); textField_1 = new JTextField(); textField_1.setBounds(10, 42, 86, 20); panel_3.add(textField_1); textField_1.setColumns(10); lblDenotesThat = new JLabel("* Denotes that the amount is entered on the main screen."); lblDenotesThat.setBounds(85, 190, 283, 14); frame.getContentPane().add(lblDenotesThat); btnCancel = new JButton("Cancel"); btnCancel.setBounds(390, 215, 89, 23); frame.getContentPane().add(btnCancel); btnOk = new JButton("OK"); btnOk.setBounds(291, 215, 89, 23); frame.getContentPane().add(btnOk); } } </code></pre> <p>Again...Thanks For The Help</p> <p>Thx Andrew I did forget the question....What am I doing wrong?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload