Changing font and background color for all components

Hi,
This is my first time writing a GUI, and I'm pretty new to Swing and Java. I just recently switched from C++, and so far Java seems to be doing a nice job =)
Currently I have a gazilion components (textfields, labels, panels) and I'm wondering if there is a way to change their background/foreground colours without adding in setBackground/setForeground for every single component.
I've done some researching onto using Look and Feel, but there aren't any current ones that suits my needs. And everyone seems to mention that programming your own is pretty complicated.
My boss wants a slick white text on black background interface, so you can imagine that he's not very impressed with the current default greyish colours =)
Thank you for any help!
Cindy

Hi Cindy,
I'm not sure how effective a solution this will be, but you could try:UIManager.put("TextField.background", Color.BLACK); // Default text field background becomes blackThere are many more defaults you'd have to change and could probably achieve it more reliably and simply by creating or editing the properties file that controls the way the look and feel (even if it's the default) is implemented. Take a look at:
http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/UIManager.htmlHope this is helpful
Chris.

Similar Messages

  • Setting fonts and Background color

    Hi,
    Is there anyway to set the font and background color on a jLabel? Thanks for your help!

    ...emmmm lets see... for the font and the background...
    maybe setFont and maybe setBackground!
    http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JComponent.html

  • How to change foreground and background color using CC SDK?

    Hello all,
    I am just starting to study the sdk (Mac CC). Currently, I am seeking the answer to change foreground and background color using CC SDK?
    Is it possible to do so? In addition, will the Image Mode such as RGB, CYMK or Grayscale be effecting such solution?
    Thanks in advance.

    These are NOT dropdown menus. They are dropdown LISTS.
    http://web.me.com/toad.hall/Demo1/Drop_DownMenus.html
    And from the links in the Google search you can learn that a list item has no style.
    And a dropdown list behaves differently from dropdown menus. Here's how it looks on Mobile Safari :

  • Disabled font and background color

    I am trying to change the font and background color of a disabled h:inputtext tag. Currently, if I set disabled=true on an h:inputtext tag, the background in gray and the font is white. I would like to somehow customize that to be background gray and font color black. Any ideas?

    Check these
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ccb6bcf4-0401-0010-e3bc-ec0ef03e13d1
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d2b1d790-0201-0010-25b7-d1fb059a8ad9
    Regards, Anilkumar
    P.S : https://www.sdn.sap.com/irj/sdn/advancedsearch?query=theme&cat=sdn_library
    Message was edited by:
            Anilkumar Vippagunta

  • My background color for all pages has changed to pink, how do I get it back to white?

    The background color in all of my screens has switched to pink. How do I get it back to white? I wonder if it changed when I was shopping in a web site and had clicked on a pink watch(?)

    Check the default color settings:
    *Tools > Options > Content : Fonts & Colors > Colors
    * [X] "Allow pages to choose their own colors, instead of my selections above"
    *https://support.mozilla.com/kb/Changing+fonts+and+colors

  • How to give Common Background color for all JPanels in My Swing application

    Hi All,
    I am developing a swing application using The Swing Application Framework(SAF)(JSR 296). I this application i have multiple JPanel's embedded in a JTabbedPane. In this way i have three JTabbedPane embedded in a JFrame.
    Now is there any way to set a common background color for the all the JPanel's available in the application??
    I have tried using UIManager.put("Panel.background",new Color.PINK);. But it did not work.
    Also let me know if SAF has some inbuilt method or way to do this.
    Your inputs are valuable.
    Thanks in Advance,
    Nishanth.C

    It is not the fault of NetBeans' GUI builder, JPanels are opaque by default, I mean whether you use Netbeans or not.Thank you!
    I stand corrected (which is short for +"I jumped red-eyed on my feet and rushed to create an SSCCE to demonstrate that JPanels are... mmm... oh well, they are opaque by default... ;-[]"+)
    NetBeans's definitely innocent then, and indeed using it would be an advantage (ctrl-click all JPanels in a form and edit the common opaque property to false) over manually coding
    To handle this it would be better idea to make a subclass of JPanel and override isOpaque() to return false. Then use this 'Trasparent Panel' for all the panels where ever transparency is required.I beg to differ. From a design standpoint, I'd find it terrible (in the pejorative sense of the word) to design a subclass to inconsistently override a getter whereas the standard API already exposes the property (both get and set) for what it's meant: specify whether the panel is opaque.
    Leveraging this subclass would mean changing all lines where a would-be-transparent JPanel is currently instantiated, and instantiate the subclass instead.
    If you're editing all such lines anyway, you might as well change the explicit new JPanel() for a call to a factory method createTransparentJPanel(); this latter could, at the programmer's discretion, implement transparency whichever way makes the programmer's life easier (subclass if he pleases, although that makes me shudder, or simply call thePanel.setOpaque(false) before returning the panel). That way the "transparency" code is centralized in a single easy to maintain location.
    I had to read the code for that latter's UI classes to find out the keys to use (+Panel.background+, Label.foreground, etc.), as I happened to not find this info in an authoritative document - I see that you seem to know thoses keys, may I ask you where you got them from?
    One of best utilities I got from this forum, written by camickr makes getting these keys and their values very easy. You can get it from his blog [(->link)|http://tips4java.wordpress.com/2008/10/09/uimanager-defaults/]
    Definitely. I bit a pair of knucles off when discovered it monthes after cumbersomely traversing the BasicL&F code...
    Still, it is a matter-of-fact approach (and this time I don't mean that to sound pejorative), that works if you can test the result for a given JDK version and L&F, but doesn't guarantee that these keys are there to stand - an observation, but not a specification.
    Thanks TBM for highlighting this blog entry, that's the best keys list device I have found so far, but the questions still holds as to what specifies the keys.
    Edited by: jduprez on Feb 15, 2010 10:07 AM

  • No Background Color for ALL DAY EVENTS

    Is there a way to prevent the background color from All-Day-Events in iCal? I would prefer to print/view the calendar w/o the background colors.

    No one answered

  • I have trouble reading in Black and White. changing the background color for all

    I have trouble reading in Black and White. On my PC I can change the background  color (and I am not just talking about for a word or pages document) but for eveything so anything that was a white background I can put in what ever color I like but it still prints in Black and white.. I can't see how to do this on the Macbook air. on my PC I do this in display. Sort of putting colored film over the screen I dont know what to do. Can anyone help?

    Hello Floridamacbookpro,
    You may be interested in the 'invert colors' Accessibility feature. This can be invoked by pressing the Control, Option, Command, and 8 keys on your keyboard. This only affects your display, and does not have any affect on printed items.
    Mac OS X displays inverted image colors (white on black, reverse type)
    http://support.apple.com/kb/HT3488
    Cheers,
    Allen

  • An applescript to change the background color for all finder windows

    I'll start off by telling you what I am trying to achieve, then show you what I've tried.
    I have a macbook with several HDD's attached. what I want is for each of those hdd to have a specific finder window background color. so no matter where I am in that hdd the background color will always be the same. so for instance if I set the background color of hdd 2 to blue then as long as I see a blue background I know that I'm within hdd 2.
    I've tried setting up an applescript to do this but can only get it to change the open finder window, and none of the subfolders have their backgrounds changed.
    here is what I have so far:
    tell application "Finder"
    tell the icon view options of the front Finder window
    set the background color to {52942, 54484, 31097}
    end tell
    end tell
    so how do I get this to apply to all subfolders without opening each one and running the script.
    thanks in advance for any and all help with this

    According to this article:
    http://docs.info.apple.com/article.html?path=AppleScript/2.1/en/as2039.html
    it seems that the various options can only be set while the window is open and in icon view.
    Rather than manually opening the window of every single folder on the hard drive, it should be possible to write a script to open every folder in sequence, make sure it is in icon view, change its background, then close its window. I have never been any good at the "actions within actions" procedure needed for folders within folders, so maybe someone else with the necessary knowledge and experience might be able to assist in this regard. Such a script would probably take a few minutes to complete while it ran through "every folder of every folder", but it sure would be quicker to have the process automated than to do it by hand - computers are really good at repetitive tasks (as long as the instructions are accurate, of course!).
    On the other hand, you might like to try the following:
    open a few windows in icon view, choose Show View Options in the View menu (I'm in System 10.4), click the radio button All Windows, click the Color radio button under Background, then choose your color. It might achieve what you are trying to do.

  • Change text and background color when multiple tracks of text

    I am finishing up a project and the client wants the final title card to be white background with colored text. I have read a bit about how to do this but I can't fit it into my situation. My text is on four different tracks, each piece of text "For more information," "email address", "contact", "phone number" So I need to change each one. But the way that I have read about it, it seems those answers are only for one level of text.
    Help?

    You should probably be using boris title 3D rather than the default text generator.  title 3D is part of the fcp default install and is available in the same generator options where the text generator is found under Boris.
    It will allow you to conbine fonts, font sizes, etc in the same clip.
    And then you'll just have to put a color matte on a video track under the clip.
    You can of course just put all your text clips on a track above the color matte and manually change the color of all the text.

  • Tableview Cell - setting the font and background colors

    Hi,
    I am developing a BSP with a Tableview. The user asked me about displaying a row with a diferent color (font or background) when some data changes on this table.
    I am thinking about using a Tableview Iterator to evaluate the content of a cell... but I dont know if I can change the look and feel of the row on where this cell is.
    Has someone dealed with this? Can you tell me how?
    thanks
    Ariel

    Actually this is the whole purpose of the Iterator.
    I would suggest you take a look at the SBSEXT_HTMLB and SBSEXT_TABLE BSP Application as well as the following weblogs.
    /people/thomas.jung3/blog/2004/09/15/bsp-150-a-developer146s-journal-part-xi--table-view-iterators
    /people/sap.user72/blog/2004/09/07/bsp-howto-exploring-bsp-development-and-the-miniwas-620
    /people/sap.user72/blog/2004/08/27/bsp-howto-tableview-iterator--column-header-graphics
    /people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator
    In those examples you'll see how easy it is to alter the content of the current cell or a cell with a specific value and output anything from graphics to input fields or dropdown boxes or even just change the text, color and styles of the content.

  • Changing font and background

    How can i change the font and the background of the Total row in the report?

    Hi Cindy,
    I'm not sure how effective a solution this will be, but you could try:UIManager.put("TextField.background", Color.BLACK); // Default text field background becomes blackThere are many more defaults you'd have to change and could probably achieve it more reliably and simply by creating or editing the properties file that controls the way the look and feel (even if it's the default) is implemented. Take a look at:
    http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/UIManager.htmlHope this is helpful
    Chris.

  • How to change the font and background color in PowerShell

    From your error messages to your output parameters, changing the colors of different PowerShell variables and outcomes is a straightforward and useful way to customize your PowerShell console. You can quickly identify ouputs, error messages, parameters and more with simple color cues – and when you're dealing with a longer script, being able to quickly identify anything is a huge help.In aguide on how to configure and customize your color settingsin PowerShell, Petri walks through each and every step, and even donates some of itsown custom PowerShell color themes scripts. (It should be noted that this only works for PowerShell console and not PowerShell ISE.) You can access your color configuration by entering:Powershell$host.privatedataThis will pull up a list of all your colors as they are currently set.Image credit:Jeff HicksNow...
    This topic first appeared in the Spiceworks Community

    Use a custom Renderer. This is the JTable tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

  • How to change fonts and background in a finder window?

    I have searched all over the system (10.5.4) and can't figure out how to change the font that displays the text in any finder window.
    I know you used to be able to change the background of any finder window too.
    I must be getting old!
    Any ideas?

    I don't think you can change the typeface (at least not with 3rd party hackies such as what Unsanity offers), but you can change the typeface size. With the Finder active click Cmd-J (View->Show View Options) and choose a different font size.
    Hope this helps

  • Change BgColors, FgColors for all Components in a Container?

    Is there a possibility to change the Background Color, the Foreground Color and the Fontsettings for all Components in a Container? Each Component in the Container should get the Colorsettings of the Container...

    Just overwrite the add, setBackground(), setForeGround() and the Font-methods of the Container:
    public void add(Component c){
    super.add(comp);
    comp.setBackground(...);
    comp.setForeground(...);
    //...the Font-stuff
    public void setBackground(Color c){
    for(int i=0;i< getComponentCount(), ++i){
    getComponenetAt(i).setBackground(c);
    //the same for setForeground and the Font-methods.

Maybe you are looking for

  • Settings

    Recently I got an UNLOCKED Blackberry Curve 9300 and it recognises my Tesco rolling contract sim, But I am still unable to make/recieve calls/texts. Apparently I may need "APN" settings and the Tesco website itself says "The Tesco Mobile phone settin

  • Run-time error '429':Active X component can not create an object

    Hi Folks, I am using some VBA code to run logic in BPC for Excel. When i try to click on VBA button, It's giving the below error.However when i am trying to execute same from server it is working fine. Accessing from BPC client only we are facing thi

  • My Acrobat X, version 10.0.0 upgrade fails?

    I am running Windows 7, Pro-64 and when I attempt to install an update it fails due to lack of administrative control, even though I log out as me and back in as the administrator.

  • HELP***iCloud storage help needed

    Can you let me know why if I have 14 gb of space left in my 50 gb plan that icloud won't let me back up my phone on icloud?  It says I have run out of run, yet I have 14 gigs left??

  • Javax.ejb.EJBException: Transaction aborted

    Hello everyone, I am new in javaEE6. When i try to develop and simple example i meet this error but i can't find which code line cause it. I use JSF EJB3.1 EclipseLink JPA 2.0 in Glassfish v3 and developed in Netbean6.8. Here is my Stack trace . Caus