-->
0 Members and 1 Guest are viewing this topic.
JFrame.setDefaultLookAndFeelDecorated(true); Loading = new JFrame(""); Loading.setAlwaysOnTop(true); Loading.setLayout(null); Loading.setUndecorated(true); Loading.getRootPane().setWindowDecorationStyle(JRootPane.NONE); JLabel LoadingText = new JLabel("Loading... - Please wait."); LoadingText.setBounds(250,0,500,15); LoadingText.setHorizontalAlignment((int)JFrame.CENTER_ALIGNMENT); LoadingText.setForeground(Color.WHITE); LoadingBar.setMinimum(0); LoadingBar.setMaximum(100); LoadingBar.setValue(0); LoadingBar.setForeground(Color.GREEN); LoadingBar.setBackground(Color.RED); LoadingBar.setBounds(0,30,1000,30); Loading.getContentPane().add(LoadingText); Loading.getContentPane().add(LoadingBar); Loading.setBounds(Toolkit.getDefaultToolkit().getScreenSize().width/2-500,Toolkit.getDefaultToolkit().getScreenSize().height/2-100,1000,200); Loading.setBackground(Color.BLACK); Loading.setFocusable(true); Loading.setVisible(true);
import javax.swing.*;import java.awt.*;class jframtest { public static void main (String[] args) { JFrame myFrame = new JFrame(); myFrame.setDefaultLookAndFeelDecorated(true); myFrame.setBackground(Color.BLACK); myFrame.setSize(400,400); myFrame.setVisible(true); }}
import javax.swing.*;import java.awt.*;class javaframetest { public static void main (String[] args) { JFrame myFrame = new JFrame(); myFrame.setDefaultLookAndFeelDecorated(true); myFrame.getContentPane().setBackground(Color.BLACK); myFrame.setSize(400,400); myFrame.setVisible(true); }}
Thanks. It works now.