I try to use AWTUtilities if these are enabled so I use the ways
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import javax.swing.*;
public class MenuPrincipal extends Llaves{
JFrame Frame=new JFrame();
};
public MenuPrincipal() {
try {Class.forName("com.sun.awt.AWTUtilities"); } catch (Exception e) {}
Frame.setSize(600, 500);
Frame.setResizable(false);
Frame.setUndecorated(true);
Frame.setLayout(null);
Frame.setLocationRelativeTo(null);
Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Frame.getContentPane().setBackground(Color.WHITE);
try {AWTUtilities.setWindowOpaque(Frame, false); } catch (Exception e) {}
}
so it shows an error when I try to compile with netBeans
try {AWTUtilities.setWindowOpaque(Frame, false); } catch (Exception e) {}
but if I use this import, the problem is solved
import com.sun.awt.AWTUtilities;
but when I run the jar in a PC without AWTUtilities it throws an error in the import
import com.sun.awt.AWTUtilities;
I can't put a try catch() in the import, so what can I do?