Created
March 1, 2023 19:01
-
-
Save dahool/d07d8b637ac8c1cfead1e301a0d2a5e9 to your computer and use it in GitHub Desktop.
Revisions
-
dahool renamed this gist
Mar 1, 2023 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
dahool created this gist
Mar 1, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ public class MyPanel extends JPanel { private JLabel jcomp1; private JLabel jcomp2; private JLabel statusPrinter; private JLabel statusPinpad; public MyPanel() { //construct components jcomp1 = new JLabel ("Impresora"); jcomp2 = new JLabel ("PinPad"); statusPrinter = new JLabel ("-"); statusPinpad = new JLabel ("-"); //adjust size and set layout setPreferredSize (new Dimension (262, 94)); setLayout (null); //add components add (jcomp1); add (jcomp2); add (statusPrinter); add (statusPinpad); //set component bounds (only needed by Absolute Positioning) jcomp1.setBounds (10, 20, 70, 25); jcomp2.setBounds (10, 55, 75, 25); statusPrinter.setBounds (85, 20, 165, 25); statusPinpad.setBounds (85, 50, 170, 25); } public static void main (String[] args) { JFrame frame = new JFrame ("MyPanel"); frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); frame.getContentPane().add (new MyPanel()); frame.pack(); frame.setVisible (true); } }