import java.awt.*; import java.awt.event.*; import java.awt.font.*; import java.awt.geom.*; import java.awt.image.*; import java.lang.*; import java.io.*; import javax.swing.*; import java.lang.String.*; import java.util.ArrayList ; public class Interfaz { public static JFrame frame; public static JSplitPane juegoPane; public static JSplitPane paneDos; public static PalabraPanel panelP; //para el panel que contiene el estado actual de la palabra advinada public static CaracterPanel panelCh;//para el panel que contiene las letras adivinadas falsas public static ColgadoPanel panelC; public static FinPanel panelF; //para el panel que contiene el imagen actual del colgado public static Menu menu; public static Juego juego; public static MenuListener menuListener; public static EnterWordListener enterwordListener; public Interfaz() { frame = new JFrame(".::: EL Colgado :::."); paneDos = new JSplitPane(); frame.setSize(900,660); menu = new Menu(); menuListener = new MenuListener(); if(frame.getKeyListeners().length != 0) frame.removeKeyListener(frame.getKeyListeners()[0]); frame.addKeyListener(menuListener); frame.setFocusable(true); paneDos.getLeftComponent().setMinimumSize(new Dimension(420,400)); //Inicio del juego juegoPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, menu, paneDos); frame.getContentPane().add(juegoPane); juegoPane.getTopComponent().setMinimumSize(new Dimension(800,200)); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } public static void main(String[] args) { Interfaz interfaz = new Interfaz(); } public static void setTopComponent(JPanel panel) { juegoPane.setTopComponent(panel); juegoPane.getTopComponent().setMinimumSize(new Dimension(800,200)); } public static JPanel getTopComponent() { return (JPanel)(juegoPane.getTopComponent()); } public static JPanel getLeftComponent() { return (JPanel)(paneDos.getLeftComponent()); } public static void setLeftComponent(JPanel panel) { paneDos.setLeftComponent(panel); paneDos.getLeftComponent().setMinimumSize(new Dimension(420,400)); } public static void setRightComponent(JPanel panel) { paneDos.setRightComponent(panel); } public static JPanel getRightComponent() { return (JPanel)(paneDos.getRightComponent()); } public static void setFrameSize(int xTopPanel, int yTopPanel) { juegoPane.getTopComponent().setMinimumSize(new Dimension(xTopPanel, yTopPanel)); } }