Writing own GUI for the game.
I want to write simply 2D multiplayer game, but not here is my problem. Problem is with GUI;/.
I want to buttons with my Icons, so I create them in this way:
start =new JButton();
start.setFocusable(false);
start.setBorder(null);
start.setContentAreaFilled(false);
start.setIgnoreRepaint(true);
start.setIcon(new ImageIcon("c:\\images\\start.png"));
start.setRolloverIcon(new ImageIcon("c:\\images\\start_mouse.png"));
start.addActionListener(this);
More, I create own RepaintManger, which doesnt repaint my components (I do it menuLoop with method:
frame.getLayeredPane().paintComponents(g);
Where frame is reference to JFrame FullWIndow Screen and g Graphics2D.
It's works fine. But when I "change" my menu with:
screen.getFullScreenWindow().getLayeredPane().removeAll();
menu = loginMenu.getMenu();
menu.setLocation((screen.getWidth() - menu.getWidth()) / 2,
(screen.getHeight() - menu.getHeight()) / 2);
screen.getFullScreenWindow().getLayeredPane().add(menu,
javax.swing.JLayeredPane.MODAL_LAYER);
// menuLoop(); app returns to gameLoop and draw there menu all the time
setGameState(GameStates.GAME_MENU);
menu is JPanel, and method loginMenu.getMenu(); returns JPanel with created buttons and text fields (maybe this is not good method to swich menus - which will be better? - but it works). Here is the problem. With TextFields, when i type in them fast my application freezes.
I even set setIgnoreRapaint(true) in this fields, but this doesnt help.
Is the problem in Threads? I think so, but I don't know how to eliminate it.
Thanks for any help.

