setTranslucency( f ); f.setUndecorated( true ); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setBackground(new Color(0f, 0f, 0f, 1f / 3f)); f.add(new Translucent()); f.pack(); f.setVisible(true);
this.add(b); f.getRootPane().setDefaultButton(b); this.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_Q, 0), EXIT); GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice dev = env.getDefaultScreenDevice(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setBackground(Color.darkGray); f.setResizable(false); f.setUndecorated(true); f.add(this); f.pack(); dev.setFullScreenWindow(f);
package test; import javax.swing.*; import java.awt.Color; import java.awt.BorderLayout; public class See { public static void main( String [] args ){ JFrame frame = new JFrame(); frame.setBackground( Color.orange ); frame.add( new JPanel(){{ add( new JLabel("Center")); setBackground(new Color(0,0,0,64)); }} , BorderLayout.CENTER ); frame.add( new JLabel("North"), BorderLayout.NORTH); frame.add( new JLabel("South"), BorderLayout.SOUTH); frame.pack(); frame.setVisible( true ); } }
final int FRAME_HEIGHT=600; frame.setSize(FRAME_WIDTH,FRAME_HEIGHT); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); frame.setBackground(Color.BLUE); frame.setBackground(Color.RED);
myScrolledComponent.setBackground(Color.YELLOW); myScrolledComponent.setOpaque(false); myScrolledComponent.add(new JLabel("Some text"), BorderLayout.CENTER); f.setBackground(Color.BLUE); ScrollPaneTest test = new ScrollPaneTest(); test.setBackground(Color.RED); f.add(test); f.pack(); f.show();
import java.awt.*; import javax.swing.*; public class Tmp extends Frame { public static void main(String[] args) { //Frame tmp = new Frame(); Frame tmp = new JFrame(); tmp.setBackground(new Color(107, 106, 104)); tmp.setSize(40,40); tmp.setVisible(true); }}
mainJFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); mainJFrame.setBackground(Color.BLUE); mainJFrame.add(timeObject.getGUI()); mainJFrame.setVisible(true); buttonPanel = new JPanel(); buttonPanel.setBackground(Color.RED); buttonPanel.add(timeButton); buttonPanel.add(moneyButton); buttonPanel.add(hotelButton); buttonPanel.add(exitButton);
String calories = "this many"; this.setBackground(Color.WHITE); this.setLayout(new BorderLayout()); this.add(button, BorderLayout.PAGE_START); new URL("http://i.imgur.com/T8x0I29.png")); timer.setIcon(timerIcon); this.add(timer, BorderLayout.CENTER); this.add(button, BorderLayout.LINE_START); JFrame f = new iWorkoutScreen(); f.setLocationByPlatform(true); f.setVisible(true); } catch (MalformedURLException ex) { ex.printStackTrace();
setBackground(Color.black); setTitle("Timer Problem Example"); setSize(950, 600); setDefaultCloseOperation(3); setVisible(true);
f.setBackground(Color.BLUE); ScrollPaneTest2 scrollPane = new ScrollPaneTest2(); scrollPane.setBackground(Color.RED); f.add(scrollPane); myScrolledComponent.add(new JLabel("Some text"), BorderLayout.CENTER);
public class view extends javax.swing.JFrame { public view() { initComponents(); mainPanel.setOpaque(false); setUndecorated(true); setBackground(new Color(0, 0, 0, 0)); setLocationRelativeTo(null); setVisible(true); } }
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setBackground(new Color(0f, 0f, 0f, 0.3f)); f.setUndecorated(true); f.add(new Translucent()); f.pack(); f.setLocationRelativeTo(null); f.setVisible(true);
windowContent.setLayout(gl); windowContent.add(ownedListLabel); ownedList.setText("ownedList"); windowContent.add(ownedList); windowContent.add(neededListLabel); neededList.setText("NeededList"); windowContent.add(neededList); frame.setBackground(Color.BLACK); removeFromNeeded.setForeground(Color.RED); removeFromOwned.setForeground(Color.RED); frame.setSize(200,200); frame.setVisible(true);
super("Top Level Demo"); setSize(300, 250); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); setBackground(Color.white); addMouseMotionListener(this);
import java.awt.Color; import java.awt.Frame; public class B2Frame extends Frame { public static void main(String[] args) { new Frame() {{ setBackground(Color.YELLOW); setSize(400,340); setVisible(true); }}; } }
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setBackground(new Color(0xfff0f0f0)); f.setLayout(new GridLayout(0, 1)); f.add(createToolBar(f)); f.add(variantPanel("mini")); f.add(variantPanel("small")); f.add(variantPanel("regular")); f.add(variantPanel("large")); f.pack(); f.setLocationRelativeTo(null); f.setVisible(true);
JPanel nPanel3 = getNode(30, 30, 20, 20, Color.green, 3); JLayeredPane pane = new JLayeredPane(); pane.add(nPanel, new Integer(1)); pane.add(nPanel2, new Integer(2)); pane.add(nPanel3, new Integer(3)); public void run() { JPanelParent jpp = new JPanelParent(); jpp.setVisible(true); jpp.setSize(300, 300); jpp.setBackground(Color.black);
import javax.swing.*; import java.awt.*; import java.awt.event.*; class TransparentFrame2 extends JFrame { public TransparentFrame2() { setTitle("Transparent Frame Demo"); setUndecorated(true); getRootPane().setWindowDecorationStyle(JRootPane.FRAME); setBackground( new Color(0, 0, 0, 0) ); setSize(400,400); setDefaultCloseOperation(EXIT_ON_CLOSE); setVisible(true); } public static void main(String args[]) { new TransparentFrame2(); } }
import java.awt.Color; import java.awt.Frame; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; public class Test { public static void main(String[] args) { Frame frame = new Frame("Title"); frame.setSize(400, 400); frame.setLocationRelativeTo(null); frame.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { System.exit(0); } }); frame.setBackground(Color.BLUE); frame.setVisible(true); } }
import javax.swing.*; import java.awt.Color; public class MyApp { public static void main( String [] args ) { JFrame frame = new JFrame(); frame.setBackground( new Color(0,0,0,64 )); frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); JPanel top = new JPanel(); top.add( new JLabel("What is your name"){{ setForeground(Color.white); }}); top.add( new JTextField(10) ); frame.add( top ); frame.pack(); frame.setVisible( true ); } }