Acá les dejo el código de la ventana externa (JFrame2)
Código:
public class VentanadeControlExterna extends JFrame { private JPanel contentPane; static PanelControlPedidos controPedidos; ///PANEL QUE TIENE EL TABLE private QueDiaEsHoy queDiaEsHoy = new QueDiaEsHoy(); private static Contador_TablaPedido contador; JLabel lbl_QueHoraEs = new JLabel(""); /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { VentanadeControlExterna frame = new VentanadeControlExterna(contador,controPedidos); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the frame. */ public VentanadeControlExterna(Contador_TablaPedido contador,PanelControlPedidos controPedidos) { this.contador = contador; this.controPedidos = controPedidos; //actualizarDatos(); TimerIndicarLaHoraMinutosSegundos(); GroupLayout groupLayout = new GroupLayout(getContentPane()); groupLayout.setHorizontalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGap(0, 450, Short.MAX_VALUE) ); groupLayout.setVerticalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGap(0, 300, Short.MAX_VALUE) ); getContentPane().setLayout(groupLayout); setTitle("Ventana de Control Externa de Pedidos"); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setBounds(100, 100, 1083, 879); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); JScrollPane scrollPane = new JScrollPane(); controPedidos.getTable_Pedidos().setFont(new Font("Droid Sans", Font.PLAIN, 60)); scrollPane.setColumnHeaderView(controPedidos); controPedidos.table_Pedidos.setRowHeight(120); ///Modifica el espaciado entro las filas controPedidos.table_Pedidos.getTableHeader().setFont(new Font("Droid Sans", Font.PLAIN, 30));////Modifica el Tamaño de las Cabeceras lbl_QueHoraEs.setFont(new Font("Dialog", Font.PLAIN, 55)); lbl_QueHoraEs.setText(""); lbl_QueHoraEs.setHorizontalAlignment(SwingConstants.CENTER); //Centra el Jlabel, Tambien se modifico el Anchored Left GroupLayout gl_contentPane = new GroupLayout(contentPane); gl_contentPane.setHorizontalGroup( gl_contentPane.createParallelGroup(Alignment.LEADING) .addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 1074, Short.MAX_VALUE) .addGroup(gl_contentPane.createSequentialGroup() .addGap(401) .addComponent(lbl_QueHoraEs, GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addGap(411)) ); gl_contentPane.setVerticalGroup( gl_contentPane.createParallelGroup(Alignment.TRAILING) .addGroup(gl_contentPane.createSequentialGroup() .addComponent(lbl_QueHoraEs, GroupLayout.DEFAULT_SIZE, 71, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, 886, GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); contentPane.setLayout(gl_contentPane); controPedidos.setVisible(true); }