Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I do not think that you can do anything about the colors or images in the title bar of a JFrame, at least not without using native code to implement a platform-specific solution. That is because JFrame actually uses your native windowing system to create the window.</p> <p>As for internal frames, it would make sense for you to be able to customize it, since it is a component rendered inside of a window that is controlled by Java. Indeed, there are plenty of <a href="http://www.java2s.com/Tutorial/Java/0240__Swing/CustomizingaJInternalFrameLookandFeel.htm" rel="nofollow">JInternalFrame properties</a> that you can set in your UI manager. </p> <p>You cannot place an image over there. However you can try <a href="http://www.oracle.com/technetwork/java/javafx/samples/index.html" rel="nofollow">JavaFX</a>.</p> <p>Here is something i did by trying out looks and feel :</p> <pre><code>import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.metal.*; public class TitleColor { public static void main_helper (String args[]) { JFrame f = new JFrame (); f.setDefaultCloseOperation ( JFrame.DISPOSE_ON_CLOSE ); f.setSize (300, 300); f.setLocationRelativeTo (null); f.setUndecorated ( true ); f.getRootPane ().setWindowDecorationStyle ( JRootPane.FRAME ); JPanel panel = new JPanel (); panel.setBackground ( java.awt.Color.white ); f.setContentPane ( panel ); DefaultMetalTheme z = new DefaultMetalTheme () { //inactive title color public ColorUIResource getWindowTitleInactiveBackground() { return new ColorUIResource (java.awt.Color.orange); } //active title color public ColorUIResource getWindowTitleBackground() { return new ColorUIResource (java.awt.Color.orange); } //start ActiveBumps public ColorUIResource getPrimaryControlHighlight() { return new ColorUIResource (java.awt.Color.orange); } public ColorUIResource getPrimaryControlDarkShadow() { return new ColorUIResource (java.awt.Color.orange); } public ColorUIResource getPrimaryControl() { return new ColorUIResource (java.awt.Color.orange); } //end ActiveBumps //start inActiveBumps public ColorUIResource getControlHighlight () { return new ColorUIResource (java.awt.Color.orange); } public ColorUIResource getControlDarkShadow () { return new ColorUIResource (java.awt.Color.orange); } public ColorUIResource getControl () { return new ColorUIResource (java.awt.Color.orange); } //end inActiveBumps }; MetalLookAndFeel.setCurrentTheme ( z ); try { UIManager.setLookAndFeel ( new MetalLookAndFeel () ); } catch (Exception e) { e.printStackTrace (); } SwingUtilities.updateComponentTreeUI (f); f.setVisible (true); } public static void main (final String args[]) { SwingUtilities.invokeLater ( new Runnable () { public void run () { main_helper ( args ); } } ); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload