Color of a titled border

- I created a panel with a titled border.
- I have a background image.
- There is a gray rectangle around the title in the border that I don't
want to have because I want to see the background image.
How can I handle this?? With panel I used setOpaque(false) but what can I do with border?

Hi,
How do you create the titled border? Are adding a border to your titled
border?
If you haven't, try this:
jPanel.setBorder(new javax.swing.border.TitledBorder(null, "TITLE", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 11), new java.awt.Color(51, 0, 102)));
I've just pasted this from one of my apps, and I don't have any gray rectangle arround the title...
Hope it helps,
ANeto

Similar Messages

  • Changing the text color of a titled border

    Hello everyone,
    I have an applet that I have created. The background color of the applet is black. My jpanels have titled borders. I cannout figure out how to change the color of the titled border text to a different color other than black. Can anyone tell me how to do this please?
    Dave

    Hi,
    Not exactly sure what you are putting a border around, but here is one example of using a border and changing the color and the placement of the title. In this instance editor is a JTextPane:
    TitledBorder tb = new TitledBorder("Title");
    tb.setTitleColor(new Color(128,0,0));
    tb.setTitleJustification(TitledBorder.LEFT);
    editor.setBorder(tb);
    Joel

  • How to change color in the title line?

    Hi experts, How to change color in the title line, i show an image for explained better
    !http://img688.imageshack.us/img688/9259/imagenjar.png!
    thanks

    in Views.css file
    file below object.and change border-color as you desired to reflect.
    .TitleTable {
         font-family: arial, helvetica, sans-serif;
         border-width: 0 0 4px 0;
         border-style: solid;
         border-color: #6666cc; ----> change here.
    hope this helps !
    -Niranjan K

  • Component in adf like titled border

    Hi,
    I'm using jdveloper 11.1.2.3.0
    I'm looking for a component in adf like the titled border in java swing:
    http://docs.oracle.com/javase/tutorial/uiswing/components/border.html#demo
    any idea?
    Thanks!

    Hi,
    you can use af:decorativeBox. Unlike in Swing the border is not controlled by properties but CSS (skinning). What af:decorativeBox gives you though are default color schemes you can set using properties
    Frank

  • How to change the color of a title bar

    Hello !
    I try to change the color from my title bars, but I fail.
    I tried to change the activeCaption value to an other colour, but that didn�t work. Currently I use a own LAF and set it with UIManager.setLookAndFeel("dpg.beans.GuiWindowsLookAndFeel");
    import javax.swing.UIDefaults;
    import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
    public class GuiWindowsLookAndFeel extends WindowsLookAndFeel {
      protected void initSystemColorDefaults(UIDefaults table) {
        String[] colors = {
           "activeCaption", "#B0171F" 
         loadSystemColors(table, colors, false);
    }I also used the complete stringarray from WindowsLookAndFeel and only changed that one color. Still no changes.
    Any ideas ?

    import javax.swing.*;
    import java.awt.*;
    class Testing
      public void buildGUI()
        UIManager.put("activeCaption", new javax.swing.plaf.ColorUIResource(Color.YELLOW));
        JFrame.setDefaultLookAndFeelDecorated(true);
        JFrame f = new JFrame();
        f.setSize(200,100);
        f.setLocationRelativeTo(null);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
      public static void main(String[] args)
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            new Testing().buildGUI();
    }

  • How do you change the color of the title text?

    The main title text for the tap your currently on shows up centered one line above the tab row. The default is black text, with a gray drop shadow, but that doesn't work with dark background themes/personas. How do I go about changing that text color so that its visible on a dark background. I've tried changing font stylings in general for the browser, and I've tried changing the color values in the about:config for the persona, but none of that works. How do you change the color of the title text?

    That colors option under content doesn't change the color of the title text, but thanks anyways

  • Change background color of List Title

    I am able to change the text color however, I am not able to change the background color of the Title on my List.
    The list template I am using is Vertical Unordered List without Bullets.
    Here is my code :
    <span style="color:pink"; "background-color:black">My List Title</span>.
    The text color is pink, however the background color remains blue.
    Do I need to create a new template for the list ?

    Please surround your HTML with the the following tag We need to check if your code is displaying properly.
    Scott                                                                                                                                                                                                                                                           

  • Color of JTabbedPane inner Border

    Hello,
    I like to change the Color of JTabbedPane inner Border. I have attached an example. If you run it, you can see a gray border. I like to make it green.
    thanks in advance!
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.plaf.*;
    public class Xerxes
         public JFrame vonbraun;
         public JPanel vonbraunPanel;
         public JTabbedPane planets;
         public Xerxes()
              UIManager.put("TabbedPane.selected", Color.green);          
              JDialog.setDefaultLookAndFeelDecorated(true);
         vonbraun = new JFrame();     
              vonbraun.setBackground(Color.black);
              vonbraun.setForeground(Color.green);
              vonbraunPanel = new JPanel();
              vonbraun.getContentPane().add(vonbraunPanel);
              vonbraunPanel.setBackground(Color.black);
              vonbraunPanel.setForeground(Color.green);
              vonbraunPanel.setBorder(BorderFactory.createLineBorder(Color.green));
              vonbraunPanel.setOpaque(true);
              UIManager.put("JTabbedPane.focus", Color.black);
              UIManager.put("JTabbedPane.selected", Color.black);
              planets = new JTabbedPane(JTabbedPane.BOTTOM);
              planets.addTab("Main", new XerxesHelp());
              planets.addTab("Monster", new XerxesHelp());
              planets.addTab("Save", new XerxesHelp());     
              planets.addTab("F1 - F6", new XerxesHelp());
              planets.addTab("F7 - F12", new XerxesHelp());
              planets.addTab("Help", new XerxesHelp());
              planets.addTab("About", new XerxesHelp());
              vonbraunPanel.add(planets);          
              planets.setBackground(Color.black);
              planets.setForeground(Color.green);     
                   planets.setBorder(BorderFactory.createLineBorder(Color.green));
              UIManager.put("JTabbedPane.font", new Font("Dialog", Font.ITALIC, 12));
                   UIManager.put("JTabbedPane.focus", Color.black);
              planets.setBackgroundAt(0, Color.green);
              planets.setBackgroundAt(1, Color.green);     
              planets.setBackgroundAt(2, Color.green);
              planets.setBackgroundAt(3, Color.green);
              planets.setBackgroundAt(4, Color.green);
              planets.setBackgroundAt(5, Color.green);
              planets.setBackgroundAt(6, Color.green);
              planets.setForegroundAt(0, Color.black);
              planets.setForegroundAt(1, Color.black);
              planets.setForegroundAt(2, Color.black);
              planets.setForegroundAt(3, Color.black);
              planets.setForegroundAt(4, Color.black);
              planets.setForegroundAt(5, Color.black);
              planets.setForegroundAt(6, Color.black);
              vonbraun.setSize(566,366);
              vonbraun.getContentPane().setBackground(Color.black);
              vonbraun.getContentPane().setForeground(Color.green);
              vonbraun.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              vonbraun.setVisible(true);
         public static void main(String args[])
              Xerxes hi = new Xerxes();
    import java.awt.*;
    import javax.swing.*;
    class XerxesHelp extends JPanel
    public JButton a1,a2,a3,a4;
    XerxesHelp()
         this.setLayout(new FlowLayout(FlowLayout.LEFT,33,22));
         this.setBackground(Color.black);
         this.setForeground(Color.green);
         add(a1 = new JButton("joystick"));
         a1.setBackground(Color.black);
         a1.setForeground(Color.green);
         a1.setToolTipText("hihi");
         add(a2 = new JButton("roger wilco"));
         a2.setBackground(Color.black);
         a2.setForeground(Color.green);
         a2.setEnabled(false);
         add(a3 = new JButton("intel chips"));
         a3.setBackground(Color.black);
         a3.setForeground(Color.green);
         a3.setEnabled(false);
         add(a4 = new JButton("language"));
         a4.setBackground(Color.black);
         a4.setForeground(Color.green);
         a4.setEnabled(false);
    Edited by: nixphoe666 on Sep 18, 2007 5:29 PM

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.plaf.*;
    public class Xerxes
    public JFrame vonbraun;
    public JPanel vonbraunPanel;
    public JTabbedPane planets;
    public Xerxes()
    UIManager.put("TabbedPane.selected", Color.green);
    JDialog.setDefaultLookAndFeelDecorated(true);
    vonbraun = new JFrame();
    vonbraun.setBackground(Color.black);
    vonbraun.setForeground(Color.green);
    vonbraunPanel = new JPanel();
    vonbraun.getContentPane().add(vonbraunPanel);
    vonbraunPanel.setBackground(Color.black);
    vonbraunPanel.setForeground(Color.green);
    vonbraunPanel.setBorder(BorderFactory.createLineBorder(Color.green));
    vonbraunPanel.setOpaque(true);
    UIManager.put("JTabbedPane.focus", Color.black);
    UIManager.put("JTabbedPane.selected", Color.black);
    planets = new JTabbedPane(JTabbedPane.BOTTOM);
    planets.addTab("Main", new XerxesHelp());
    planets.addTab("Monster", new XerxesHelp());
    planets.addTab("Save", new XerxesHelp());
    planets.addTab("F1 - F6", new XerxesHelp());
    planets.addTab("F7 - F12", new XerxesHelp());
    planets.addTab("Help", new XerxesHelp());
    planets.addTab("About", new XerxesHelp());
    vonbraunPanel.add(planets);
    planets.setBackground(Color.black);
    planets.setForeground(Color.green);
    planets.setBorder(BorderFactory.createLineBorder(Color.green));
    UIManager.put("JTabbedPane.font", new Font("Dialog", Font.ITALIC, 12));
    UIManager.put("JTabbedPane.focus", Color.black);
    planets.setBackgroundAt(0, Color.green);
    planets.setBackgroundAt(1, Color.green);
    planets.setBackgroundAt(2, Color.green);
    planets.setBackgroundAt(3, Color.green);
    planets.setBackgroundAt(4, Color.green);
    planets.setBackgroundAt(5, Color.green);
    planets.setBackgroundAt(6, Color.green);
    planets.setForegroundAt(0, Color.black);
    planets.setForegroundAt(1, Color.black);
    planets.setForegroundAt(2, Color.black);
    planets.setForegroundAt(3, Color.black);
    planets.setForegroundAt(4, Color.black);
    planets.setForegroundAt(5, Color.black);
    planets.setForegroundAt(6, Color.black);
    vonbraun.setSize(566,366);
    vonbraun.getContentPane().setBackground(Color.black);
    vonbraun.getContentPane().setForeground(Color.green);
    vonbraun.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    vonbraun.setVisible(true);
    public static void main(String args[])
    Xerxes hi = new Xerxes();
    import java.awt.*;
    import javax.swing.*;
    class XerxesHelp extends JPanel
    public JButton a1,a2,a3,a4;
    XerxesHelp()
    this.setLayout(new FlowLayout(FlowLayout.LEFT,33,22));
    this.setBackground(Color.black);
    this.setForeground(Color.green);
    add(a1 = new JButton("joystick"));
    a1.setBackground(Color.black);
    a1.setForeground(Color.green);
    a1.setToolTipText("hihi");
    add(a2 = new JButton("roger wilco"));
    a2.setBackground(Color.black);
    a2.setForeground(Color.green);
    a2.setEnabled(false);
    add(a3 = new JButton("intel chips"));
    a3.setBackground(Color.black);
    a3.setForeground(Color.green);
    a3.setEnabled(false);
    add(a4 = new JButton("language"));
    a4.setBackground(Color.black);
    a4.setForeground(Color.green);
    a4.setEnabled(false);
    }this are my last two questions about color! Then I posted this messages I would make an edit tag, but I cannot find it in the editor! now I have copied it without a problem and marked as code! I liked to edit my messages, but the editbutton is gone!

  • Why I cannot change font  and Color in JFrame title??

    Dear sir:
    I try to change font and Color in JFrame title in code below,
    It display all html code, not expected formatted ones.
    but fail. Looks like no way to do it??
    Can somebody help??
    Thanks
    import java.awt.BorderLayout;
    import java.awt.Toolkit;
    import javax.swing.*;
    public class JFrameTester {
      public static void main(String[] args) {
         String iconPath ="file:C:/eclipse/workspace/Test/images/long.PNG";
         String title = "<html><body bgcolor=\"yellow\">" + "<img src=\""+iconPath+"\">" +
              " <font size=\"6\" face=\"Verdana\" color=\"red\"><b>"+ "New Tester" + "</b></font></html>";
        JFrame f = new JFrame(title);
        f.setIconImage(Toolkit.getDefaultToolkit().getImage("images/123.gif"));
        f.setSize(250, 250);
        f.setLocation(300,200);
        f.getContentPane().add(new BorderLayout().CENTER, new JTextArea(10, 40));
        f.setVisible(true);
    }

    Looks like no way to do it??depends on the L&F you want.
    here's one way
    import java.awt.*;
    import javax.swing.*;
    class JFrameTester {
      public static void main(String[] args) {
        JFrame.setDefaultLookAndFeelDecorated(true);
        UIManager.put("activeCaption", new javax.swing.plaf.ColorUIResource(Color.RED));
        UIManager.put("activeCaptionText", new javax.swing.plaf.ColorUIResource(Color.YELLOW));
        String title = "Hello World";
        JFrame f = new JFrame(title);
        f.getLayeredPane().getComponent(1).setFont(new Font("Tall Paul",Font.ITALIC,24));
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setSize(250, 250);
        f.setLocation(300,200);
        f.getContentPane().add(new BorderLayout().CENTER, new JTextArea(10, 40));
        f.setVisible(true);
    }

  • Changing color on the title bar

    How can I during runtime change the color of the title bar? I want to flash the title bar to warn, but I haven't found the function to set the color of it yet...
    Thanks in advance!
    Regards,
    Andreas

    since 1.4 you can use
    JFrame.setDefaultLookAndFeelDecorated( true );
    JDialog.setDefaultLookAndFeelDecorated( true );to get jframes and jdialogs looking like jinternalframes. but i don't know if it is now possible to change the color.
    tobias

  • Color of the title bar

    HI
    How do you change the color of the title bar of a frame....also is it possible to paint an image on the tile bar so that its looks could be enhanced..pls help

    Hi Arya,
    There are 2 questions here, 1 is simple to answer the other is quite difficult.
    How do you change the color of the title bar of a frameSimply add the colors you want to the UIManager
    UIManager.put("Frame.activeTitleBackground", new ColorUIResource(YOURCOLOUR_BACKGROUND));
    UIManager.put("Frame.activeTitleForeground", new ColorUIResource(YOURCOLOUR_FOREGROUND));
    UIManager.put("Frame.inactiveTitleBackground", new ColorUIResource(YOURCOLOUR_INACTIVE_BACKGROUND));
    UIManager.put("Frame.inactiveTitleForeground", new ColorUIResource(YOURCOLOUR_INACTIVE_FOREGROUND));
    also is it possible to paint an image on the tile bar This is a bit more tricky. You will need to implement your own RootPaneUI which in turn uses a TitlePane class that represents the title bar. In your implementation of the title bar you will handle adding an image.
    Have a look at MetalRootPaneUI and MetalTitlePane to get an idea about the implementation.
    N35Sy

  • Which component creates a titled border

    Which component can I use to create a titled border around a group of radio buttons. I can't seem to find which component it is.
    Thanks

    How to Use Borders
    http://java.sun.com/docs/books/tutorial/uiswing/misc/border.html
    Create a panel, set the border and add your radio buttons to the panel.

  • Dynamically setting the color of the title in a Panel

    Hello, I know I can set the color & font of the title in a Panel using the titleStyleName in a stylesheet.  How can I dynamically change the color though?  I have a component:
             <mx:Panel id="myPanel"borderColor="{this.color1}" />
    where this.color1 is a value that changes dynamically, and thus changes the border color.  How do I do this for the color of the text in the title?

    Hi,
    Try this
    var css:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".myPanelTitle");
    css.setStyle("color",0x00FF00);

  • How can I change the color of a title bar?

    Ok, I have been looking for this answer for over a week now and nobody
    has yet given me an answer that works. So I am going to ask again.
    Here is a piece of code you can run to see what I am trying to do:
    public class RemoteDisplayFrame extends JFrame {
    public static final Color GRAY70 = new Color(179, 179, 179);
    public RemoteDisplayFrame() {
    super();
    public RemoteDisplayFrame(String title) {
    super(title);
         public void setBorderContent() {
    this.setUndecorated(true);
    JRootPane rootPane = this.getRootPane();
    rootPane.setWindowDecorationStyle( JRootPane.PLAIN_DIALOG );
    this.setRootPane( rootPane );
    public static void main( String [] args ) {
    RemoteDisplayFrame frame = new RemoteDisplayFrame( "Test Frame" );
    frame.setBorderContent();
    frame.pack();
    frame.show();
    Run this code and you should get a frame on your screen that has no
    close buttons, minimize buttons, or maximize buttons, and no menu.
    I want to change the title bar's color to a specific color.
    That color is GRAY70:
    public static final Color GRAY70 = new Color(179, 179, 179);
    If you have any idea on how to do this please do tell.

    AFAIK, you can't. I believe the title bar is rendered by the operating system, using the colors the user has chosen, consistently for all windows. Frankly, if your app could, it would annoy me, as I would still want all my windows to look consistent.

  • How/can I change the color of the title or word in a text box?

    Also, can I change the background color too? If so, how? Thanks!

    Select the title / text and then click on the "i" (inspector). A colored pin wheel shows up after you click on the square box directly below the font settings inside the inspector window. Then simply drag the dot to the color you want. Like this:
    click here
    Message was edited by: SDMacuser

Maybe you are looking for

  • Compra de serviço de manutenção

    Pessoal, Preciso desenhar um processo de compra de serviço de manutenção com o envio do material/equipamento a ser reparado. Preciso também, transferir este custo para o estoque e o cliente precisa criar a folha de serviço para fazer a medição. No pr

  • Quicktime Broadcaster v1.5 compatible with 10.4.3?

    I just upgraded to OSX, v10.4.3, and now Quicktime Broadcaster will not render audio or video. I am trying to render Video/Audio using the Firewire port and have tried both a Sony Mini DV Camera and the Sony DVMC-DA2. iMove will accept and display th

  • Why cant you drag and drop files into illustrator anymore?

    i dislike the change. Regards

  • Approval trip and advance payment

    Hi experts, I want to know if there is any standard way for making the approval trips and the advance payments. I don't have any idea about TM module, so I need help because I have to make a report making if Standard sap do or not this. I've found in

  • 9.2 taking over OS X no applications/permissions/start up disk on  OS X

    I think I found the problem, somehow file maker 4.1 got installed on my imac but I don`t know where to begin, I have no Preferences/applications/permissions on OS X and there is no access too the start up disk so what 9.2 seems to want to take over d