sigurno je memory leak, samo izgleda da ja nisam uzrocnik. Uzeo sam i izbrisao sve svoje funkcije, ostavio samo iscrtavanje panela i nekoliko dugmica(znaci nista vezivanje sa bazom, dinamicko iscrtavanje dugmica...) i ista stvar. Jos ludje je sto je kod maltene isti kao u SUN example-u. Evo ga pa ako nekom padne na pamet sta bi moglo da bude neka pise
Code:
package baman.client;
import java.awt.event.ActionListener;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import java.awt.*;
import java.awt.Dimension;
import javax.swing.JButton;
import java.awt.Rectangle;
import javax.swing.JPanel;
import java.awt.Color;
import javax.swing.JTextArea;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.Font;
import javax.swing.SwingConstants;
import javax.swing.JTextPane;
import java.util.*;
public class BarmanUITest extends JFrame implements ActionListener
{
//za full screen
private boolean waiting = false;
private Object exitLock = new Object();
private GraphicsDevice device;
private DisplayMode originalDM, mode;
private JLabel currentDM = new JLabel();
private boolean isFullScreen = false;
//
private JPanel panelGrupa = new JPanel();
private JPanel panelArea = new JPanel();
private JPanel panelKontrole = new JPanel();
private JPanel panelPodgrupe = new JPanel();
private JPanel artikliPanel = new JPanel();
private JPanel jPanel1 = new JPanel();
private JTextArea jTextPane1 = new JTextArea();
//------------------------TEST------------------------------
public BarmanUITest(GraphicsDevice device)
{
super(device.getDefaultConfiguration());
this.device = device;
originalDM = device.getDisplayMode();
mode = originalDM;
setDefaultCloseOperation(EXIT_ON_CLOSE);
try
{
jbInit();
jTextPane1.setFont(new Font("Serif", Font.ITALIC, 16));
jTextPane1.setLineWrap(true);
jTextPane1.setWrapStyleWord(true);
}
catch(Exception e)
{
e.printStackTrace();
}
}
public void actionPerformed(ActionEvent ae){
}
private void jbInit() throws Exception
{
this.getContentPane().setLayout(null);
this.setSize(new Dimension(810, 640));
panelGrupa.setBounds(new Rectangle(0, 0, 480, 60));
panelGrupa.setBackground(new Color(114, 236, 76));
panelGrupa.setLayout(null);
panelArea.setBounds(new Rectangle(480, 0, 240, 360));
panelArea.setLayout(null);
panelArea.setBackground(new Color(236, 94, 213));
panelKontrole.setBounds(new Rectangle(720, 0, 80, 600));
panelKontrole.setBackground(new Color(79, 211, 236));
panelKontrole.setLayout(null);
panelPodgrupe.setBounds(new Rectangle(0, 60, 480, 180));
panelPodgrupe.setBackground(new Color(236, 137, 71));
panelPodgrupe.setLayout(null);
artikliPanel.setBounds(new Rectangle(0, 240, 480, 360));
artikliPanel.setLayout(null);
artikliPanel.setBackground(new Color(62, 38, 236));
jPanel1.setBounds(new Rectangle(480, 360, 240, 240));
jPanel1.setBackground(new Color(236, 72, 105));
jPanel1.setLayout(null);
this.getContentPane().add(jPanel1, null);
this.getContentPane().add(artikliPanel, null);
this.getContentPane().add(panelPodgrupe, null);
this.getContentPane().add(panelKontrole, null);
panelArea.add(jTextPane1, null);
this.getContentPane().add(panelArea, null);
this.getContentPane().add(panelGrupa, null);
}
public void waitForExit()
{
waiting = true;
repaint();
synchronized (exitLock)
{
try
{
exitLock.wait();
} catch (InterruptedException e)
{
System.out.println("???????????????????");
e.printStackTrace();
}
}
}
public void begin()
{
isFullScreen = device.isFullScreenSupported();
setUndecorated(isFullScreen);
setResizable(!isFullScreen);
if (isFullScreen)
{
// Full-screen mode
try
{
device.setFullScreenWindow(this);
device.setDisplayMode(new DisplayMode(800, 600, 16, 60));
waitForExit();
} finally
{
device.setFullScreenWindow(null);
}
} else
{
// Windowed mode
pack();
setVisible(true);
}
}
public static void main(String args[]){
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] devices = env.getScreenDevices();
for (int i = 0; i < 1; i++)
{
BarmanUITest test = new BarmanUITest(devices[i]);
//test.initComponents(test.getContentPane());
test.begin();
}
}
}