i used setundecorated(true); to remove the buttons and border of the window,,the problem is the frame only stays where it is, because the title bar is removed i cant drag it around the screen anymore..
what code should i add to be able to drag it anywhere in the scree without removing the setundecorated(true);??
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class emptyframe extends JFrame implements ActionListener{
private JButton JB = new JButton("button");
public emptyframe()
{
frameformat();
add(JB);
JB.setBounds(100,50,200,50);
}
public void actionPerformed(ActionEvent e)
{
}
private void frameformat()
{
setPreferredSize (new Dimension (582, 336));
setLayout (null);
setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
setLocation(300,250);
setBackground(Color.black);
setResizable(false);
setUndecorated(true);
pack();
}
public static void main (String[] args) {
new emptyframe().setVisible(true);
}
}