Setting the Border background color

Post Author: gravy
CA Forum: .NET
Hi,
Using the API I'm trying to set the Border background color to transparent but I can't. I want to set the background color to match what the designer does when you uncheck the Background option on the Border tab of a TextObjects properties.
Can anyone help?

What release are your using?
do you want to set this dynamically, for one portlet or all. you may what to use
'Themes'
"Jorgeana" <[email protected]> wrote:
>
Does someone have a sample of setting the portlet border and background
color ?
I´m having problems using "setPortletBGColor" !! Tks

Similar Messages

  • Setting the TabbedPane background color

    Hello everyone,
    The following code does not set the tabbedpane's background color:
    class LIB
    public static void main (String ... args)
    javax.swing.JTabbedPane t=new javax.swing.JTabbedPane();
    t.setOpaque(true);
    t.setBackground(java.awt.Color.RED);
    t.setForeground(java.awt.Color.GREEN);
    t.add(new javax.swing.JLabel("HELLO"));
    t.setTitleAt(0,"Tab 1");
    javax.swing.JFrame f=new javax.swing.JFrame();
    f.getContentPane().add(t);
    f.pack();
    f.setVisible(true);
    }What is wrong with thid code ??
    Thank you

    You had an answer with in the first 10 minutes. And your post was on one of the three most popular forums.10 minutes, that is true. But then I sent a reply on Dec 6, 11:43 AM and did not get an answer until Dec 8, 5:44 AM (that is after I had already posted the same problem on another forum).
    Also, if you ever do need to post the same question on another forum at least put a link between the two.Since I am new to the forum, I don't know how to do that. Would you be kind enough to tell me how.
    Thank you

  • How can I set the foreground/background color after using CSPickColor()?

    Hello all,
    Is there any one who has experience on changing foreground or background color using Photoshop Plug-in SDK?
    Currently I can get a returned color from CSPickColor(), but have no idea how to use it.
    Thanks!

    You can try a linear-gradient that starts at gray 0% and ends at white <whatever the percentage the thumb is at>.
            final Node track = slider.lookup(".track");
            slider.valueProperty().addListener(new ChangeListener<Number>() {
                public void changed(ObservableValue<? extends Number> ov, Number t, Number t1) {
                    double pct = (t1.doubleValue()-slider.getMin())/(slider.getMax()-slider.getMin())*100;
                    track.setStyle("-fx-background-color: linear-gradient(to right, gray, gray " + pct + "%, white" + pct + "%, white);");
            });Edited by: dgrieve on Apr 12, 2012 12:19 PM

  • Guide to set the cell background color and foreground color

    hi all,
    I am using a tool called POI for excel from java. IF any body know POI please tell me the various colors --------> equivalent Short number. I need the color and equavlent number for better usage.
    please respond as early as possible.

    Hi
    Use the class HSSFColor at org.apache.poi.hssf.util and the inner classes defined, for example (sample form jakarta.poi):
    style.setFillForegroundColor(HSSFColor.ORANGE.index);
    or for a cell
    cell.setFillForegroundColor(HSSFColor.ORANGE.index);
    If you need know what index for a color may be at source code you can see the implementation.
    Hope this helps

  • Set current row background color

    during post-query process, if record meets condition,
    i would like to set the color of entire line.
    thank you
    [email protected]

    Hi Jim,
    create a visual_attribute named e.g. PQR and set the desired background color.
    In post-query trigger:
    declare
         currec number := Get_block_property('block1', current_record);
    begin     
    if "condition" then
         set_item_instance_property('item1',     currec,visual_attribute,'PQR');
         set_item_instance_property('item2',     currec,visual_attribute,'PQR');
         set_item_instance_property('item3',     currec,visual_attribute,'PQR');
    end if;
    end;
    Good luck,
    Monica

  • ListCellRenderer and JList... cannot set the selected background?

    The following code:
         public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus )
              setText( "test" );
              setBackground( isSelected ? list.getSelectionBackground() : list.getBackground() );
              setForeground( isSelected ? list.getSelectionForeground() : list.getForeground() );
              return this;
         }is having problems. It does not set the background color for the selected item. It does, however set the foreground. If I don't use my own cell renderer, the background changes as expected. I can't figure out why - I can set the border of the JLabel that is returned, the foreground, the icon, but not the background.
    What am I doing wrong?

    I would have to check, but from memory a cell is a JLabel not a JTextField. The diff is that a JLabel is transparent so the background colour is normaly that of the JPanel. In a JTable I presume the cell has some default background colour based on the table, so maybe you need to use a JTextField to define the field.
    Hope that helps,
    James.

  • How do I change the tab background color in Firefox 4?

    I just upgraded to Firefox 4. Tabs are now fine black font on dark grey background -- very hard to read. How do I change the tab background color?
    I have searched and the closest I can come is some instructions for modifying .css files, and it is not clear that those instructions will impact the tab background color.
    Thanks in advance for your help.

    Similar question asked by TH received another response.
    Here is the address of that question and answer:
    https://support.mozilla.com/en-US/questions/804464?s=change+tab+color+firefox+4&as=s
    I like the solution recommended there.
    Added information - after several days experience, I notice that some tabs occasionally revert to the original dark grey. So I am still looking for a better solution, ideally within Firefox rather than via add on. This seems like a basic setting for the browser that should be easy to change, rather than something so complex that I need an add on to change it. Or just build it without such a dark grey background to begin with and I would not need to change it.

  • How to set the border of header of JTable

    I am using the following code to set the border of my JTable headers but it doesn't seem to work!! The headers do get CENTER aligned but somehow they do not show the right border. Please Help.
    class cellAlignRenderer extends DefaultTableCellRenderer
    cellAlignRenderer()
    setHorizontalAlignment(JLabel.CENTER);
    Border b = BorderFactory.createEtchedBorder() ;
    setBorder(b);
    jTable.getColumn(0).setHeaderRenderer( new cellAlignRenderer());

    try this
    public class YourTableHeaderRenderer extends DefaultTableCellRenderer
    public YourTableHeaderRenderer()
    public Component getTableCellRendererComponent(JTable table, Object value,
    boolean isSelected, boolean hasFocus, int row, int column)
    JLabel comp = (JLabel) super.getTableCellRendererComponent(table,value,
    isSelected,hasFocus,row,column);
    try
    comp.setBorder(BorderFactory.createBevelBorder(0,Color.lightGray,Color.darkGray));
    setFont(new java.awt.Font("Dialog", 0, 15));
    setHorizontalAlignment(SwingConstants.CENTER);
    catch(Exception err)
    err.printStackTrace();
    return this;

  • How do I change the white background color in a b/w line drawing jpg?

    How do I change the white background color in a b/w line drawing jpg?

    Just put a Solid Color Layer atop it and set it to Blend Mode Multiply or
    • load the Channel with the best contrast (cmd-click it in the Channels Panel)
    • invert Selection (cmd-I)
    • create a black Solid Color Layer
    • put whatever below that Layer

  • How to set Analysis graphics background color to Transparent? not White.

    How to set Analysis graphics background color to Transparent? not White.
    thanks
    Edited by: user13257485 on 2010-8-15 下午11:53
    Edited by: user13257485 on 2010-8-15 下午11:55

    Hi,
    We almost had the same requirement, but we just needed to color a specific column.
    Here goes the solution to that, you might do the same for your row highlighting
    Changes are required in jsff and one method to be added in backing bean
    1. JSFF :
    <af:column headerText="Amount"
                     id="c4" width="100"
                     inlineStyle="#{backingBeanScope.BackingBean.cellColor}">2. Backing Bean
    //searchResultTableVO is Table's VO
    public String getCellColor() {
          FacesContext ctx = FacesContext.getCurrentInstance();
          ExpressionFactory ef = ctx.getApplication().getExpressionFactory();
          ValueExpression ve = ef.createValueExpression(ctx.getELContext(), "#{row}", FacesCtrlHierNodeBinding.class);
          FacesCtrlHierNodeBinding node = (FacesCtrlHierNodeBinding)ve.getValue(ctx.getELContext());
          Row row = node.getRow();
        if(row.equals(searchResultTableVO.getCurrentRow())){
    //You can add your inline style for font-style too
          return "background-color:Red;";
             return null;
      }Hope this is helpful :)
    Regards,
    Neha..

  • Setting a default background color

    Hi All,
    I would like to set a default background color for all the
    components that I'm going to draw. What is the best
    way to achieve this?
    Thanks.
    Syed

    You can set using UIManager of the Look and Feel.
    UIManger.put("Button.background", Color.blue);
    will set the color of all the JButtons to blue. Like that you can change for all the components you need.
    Mohan

  • How to change the Video Background Color - The Answer...Not the Question.

    Hello All,
    I was struggling with the Video Background Color as I was setting up my DVD. I'm new to DVD Studio Pro. I couldn't get the color to change from grey to the desired black. I was moments from asking for help, but thought to try just a bit harder. The answer lies under Preferences, Menu, Video Background Color. Just thought I'd share for future search strings by others.
    Ahh, onward!
    DG

    The id is applied by (I think) the skin class of the ChoiceBox. You don't need to define it.
    You have to apply the css in an external style sheet. You can apply the external style sheet to any parent of your choice box, or to the scene (the most usual way to do it).
    Example:
    import java.util.ArrayList;
    import java.util.List;
    import javafx.application.Application;
    import javafx.scene.Scene;
    import javafx.scene.control.ChoiceBox;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    public class ChoiceBoxTest extends Application {
      @Override
      public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("Example 2");
        final ChoiceBox<String> choiceBox = new ChoiceBox<>();
        List<String> tempResult = new ArrayList<String>();
        for (int i = 0; i < 10; i++) {
          tempResult.add("Item " + i);
        choiceBox.getItems().setAll(tempResult);
        VBox root = new VBox();
        root.getChildren().add(choiceBox);
        final Scene scene = new Scene(root, 300, 250);
        scene.getStylesheets().add("choiceBox.css");
        primaryStage.setScene(scene);
        primaryStage.show();   
      public static void main(String[] args) {
        launch(args);
    choiceBox.css:
    @CHARSET "UTF-8";
    #choice-box-menu-item:focused  {
    -fx-background-color: yellow ;
    #choice-box-menu-item .label {
    -fx-text-fill: black ;
    Message was edited by: James_D

  • Flex 4 lacks the default-background-color compiler option?

    Hello,
    started converting my Flex 3 applications to Flex 4 and noticed that Flex 4 lacks the default-background-color compiler option.
    Flex 3 has it: http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_14.html
    Flex 4 doesn't: http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7a92.html
    This raises a question: how am I supposed to keep my background from flashing from grey to white when the RIA is loaded? Is it possible to use preloader with background set to whatever color I like to see? Any easier solutions?
    Best regards,
    Jukka

    This works for me:
    @namespace mx "library://ns.adobe.com/flex/mx";
    mx|Application{
         background-color:#ffffff;
    Of course if you have changed the Application element to spark equivalent, you have to change the namespace.
    Regards,
    Jukka

  • Can i change the preview background color?

    Hi
    can i change the preview background color?
    it's gray , may i change it?
    thanks
    i use bridge cs6

    can i change the preview background color?
    Yes you can do so in the Bridge preferences under general both Ui interface and image backdrop can be changed
    In the same preferences Cache you can change the location of the central cache to where ever you will. But you have to realize that if you use an external disk this can cause all kinds of problems regarding speed, performance and permission issues. best to keep it on an internal disk and having an SSD available will be even better because you will benefit from performance and speed very much.
    it's gray , may i change it?
    As long as you have a legal version and it is able to change then feel free to set it to your own custom wishes...

  • Setting the desktop background image via Powershell

    UPDATE: 
    I found the solution that addressed my problem, which I posted in a post below. Keeping the original post for Internet historical reasons as I the hope this helps someone else later on in their search for a solution. 
    ===============
    I have Bing'ed and I have Google'd and I haven't found a solid answer to setting the desktop wallpaper programmically.  I am trying to do this via PowerShell, but I would be happy for any other language flavor or application to work. 
    Below is the code I have tried to set the desktop background image. This has been scrounged from a few sources across the web. This solution works 25% of the time and I haven't figured out what the cause for success or failure of the execution. Or maybe
    it's neither, but waiting for Explorer to refresh. The only way to see the change 100% is to log out and log back in.
    I am running Windows 8.1 btw. 
    Thank you for looking.
    Function Get-WallPaper()
    $wp=Get-ItemProperty -path 'HKCU:\Control Panel\Desktop\' -name wallpaper
    if(!$wp.WallPaper)
    { "Wall paper is not set" }
    Else
    {"Wall paper is set to $($wp.WallPaper)" }
    Function Refresh-Explorer {
    $code = @'
    private static readonly IntPtr HWND_BROADCAST = new IntPtr(0xffff);
    private const int WM_SETTINGCHANGE = 0x1a;
    private const int SMTO_ABORTIFHUNG = 0x0002;
    [System.Runtime.InteropServices.DllImport("user32.dll", SetLastError=true, CharSet=CharSet.Auto)]
    static extern bool SendNotifyMessage(IntPtr hWnd, uint Msg, UIntPtr wParam,
    IntPtr lParam);
    [System.Runtime.InteropServices.DllImport("user32.dll", SetLastError = true)]
    private static extern IntPtr SendMessageTimeout ( IntPtr hWnd, int Msg, IntPtr wParam, string lParam, uint fuFlags, uint uTimeout, IntPtr lpdwResult );
    [System.Runtime.InteropServices.DllImport("Shell32.dll")]
    private static extern int SHChangeNotify(int eventId, int flags, IntPtr item1, IntPtr item2);
    public static void Refresh() {
    SHChangeNotify(0x8000000, 0x1000, IntPtr.Zero, IntPtr.Zero);
    SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, IntPtr.Zero, null, SMTO_ABORTIFHUNG, 100, IntPtr.Zero);
    Add-Type -MemberDefinition $code -Namespace MyWinAPI -Name Explorer
    [MyWinAPI.Explorer]::Refresh()
    Function Set-WallPaper($Value)
    echo "Setting background to: $value"
    Refresh-Explorer
    Set-ItemProperty -path 'HKCU:\Control Panel\Desktop\' -name wallpaper -value $value
    rundll32.exe user32.dll, UpdatePerUserSystemParameters
    #sleep 1
    rundll32.exe user32.dll, UpdatePerUserSystemParameters
    #sleep 1
    rundll32.exe user32.dll, UpdatePerUserSystemParameters
    #sleep 1
    Refresh-Explorer
    #Stop-Process -ProcessName explorer
    NOTE: I left in a few commented out statements. I found that they do not offer any help in formulating a solution.
    Thank you.

    Great news! I found the solution and all props and credit goes to
    jsd1982 of the XKCD comic
    forum from a post he made in 2007 and some deep search kung-fu Googling on my part. Here is the
    direct link to the post.
    This solution has worked for me 100% of the time on Windows 8. The only gotcha I found (minor detail) was when setting this process to run as a scheduled task, I had to run it as elevated privileges for the code to compile in memory. Running this function
    from PowerShell at the command prompt was fine. 
    NOTE: The code below is a slight trimmed down version posted by jsd1982 to just set the desktop wallpaper. I removed the image fetching from the Internet and the color inversion.
    # Credit to jsd1982
    function Compile-Csharp ([string] $code, $FrameworkVersion="v2.0.50727",
    [Array]$References)
    # Get an instance of the CSharp code provider
    $cp = new-object Microsoft.CSharp.CSharpCodeProvider
    # Build up a compiler params object...
    $framework = [System.IO.Path]::Combine($env:windir, "Microsoft.NET\Framework\$FrameWorkVersion")
    $refs = new-object Collections.ArrayList
    $refs.AddRange( @("${framework}\System.dll",
    # "${mshhome}\System.Management.Automation.dll",
    # "${mshhome}\System.Management.Automation.ConsoleHost.dll",
    "${framework}\system.windows.forms.dll",
    "${framework}\System.data.dll",
    "${framework}\System.Drawing.dll",
    "${framework}\System.Xml.dll"))
    if ($references.Count -ge 1)
    $refs.AddRange($References)
    $cpar = New-Object System.CodeDom.Compiler.CompilerParameters
    $cpar.GenerateInMemory = $true
    $cpar.GenerateExecutable = $false
    $cpar.CompilerOptions = "/unsafe";
    $cpar.OutputAssembly = "custom"
    $cpar.ReferencedAssemblies.AddRange($refs)
    $cr = $cp.CompileAssemblyFromSource($cpar, $code)
    if ( $cr.Errors.Count)
    $codeLines = $code.Split("`n");
    foreach ($ce in $cr.Errors)
    write-host "Error: $($codeLines[$($ce.Line - 1)])"
    $ce |out-default
    Throw "INVALID DATA: Errors encountered while compiling code"
    [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") > $null
    [System.Reflection.Assembly]::LoadWithPartialName("System.Runtime") > $null
    # C# code to post to wallpaper
    $code = @'
    using System;
    using System.Drawing;
    using System.Drawing.Imaging;
    using System.Runtime.InteropServices;
    using System.IO;
    using System.Net;
    using Microsoft.Win32;
    namespace test
    public class Wallpaper
    const int SPI_SETDESKWALLPAPER = 20 ;
    const int SPIF_UPDATEINIFILE = 0x01;
    const int SPIF_SENDWININICHANGE = 0x02;
    [DllImport("user32.dll", CharSet=CharSet.Auto)]
    static extern int SystemParametersInfo (int uAction , int uParam , string lpvParam , int fuWinIni) ;
    public static void SetWallpaper(string uri)
    System.IO.Stream s = new WebClient().OpenRead(uri);
    Image img = System.Drawing.Image.FromStream(s);
    Bitmap copy = new Bitmap(img.Width, img.Height);
    Graphics g = Graphics.FromImage(copy);
    Rectangle rect = new Rectangle(0, 0, img.Width, img.Height);
    g.DrawImage(img, rect, 0, 0, img.Width, img.Height, GraphicsUnit.Pixel);
    g.Dispose();
    img.Dispose();
    // Save to a temp file:
    string tempPath = Path.Combine(Path.GetTempPath(), "wallpaper.bmp");
    copy.Save(tempPath, System.Drawing.Imaging.ImageFormat.Bmp);
    RegistryKey key = Registry.CurrentUser.OpenSubKey( @"Control Panel\Desktop", true ) ;
    key.SetValue(@"WallpaperStyle", 1.ToString( ) ) ;
    key.SetValue(@"TileWallpaper", 0.ToString( ) ) ;
    SystemParametersInfo( SPI_SETDESKWALLPAPER,
    0,
    tempPath,
    SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE );
    function Set-Wallpaper([string] $imgurl)
    compile-CSharp $code
    [test.Wallpaper]::SetWallpaper($imgurl)

Maybe you are looking for

  • Loops in Universe Designer.

    Hi, which one is best method to resolve the loops Context, Aliases or Shortcut join. will anyone please explain? Thanks, Imran

  • "Cloud on" and 10 other apps cannot be purchased at this time message

    How do I prevent this message from popping up each time I try to download a new app? I have deleted the app cloud on from both my iPad and through I tunes however the message still appears how do I resolve this problem as it is annoying and not what

  • Mac Pro/Bridge won't open 5DIII imported CR2s in Camera Raw, from desktop. Updates are current. WTF?

    I have a Canon 5D Mark III and also just got the Mac Pro. Everything worked fine on my old iMac with CS6. I just put the software on the Mac Pro and made all the updates; none of the CR2 files will open in camera raw. The JPEGs are showing up with th

  • Problem with 10bit RGB video

    Hello. I'm having a problem with a project which was first edited with a low res proxy; The editor sent me the complete edit, and I switched the source file to the uncompressed file. They are both exactly the same duration, frame size, etc, but the p

  • Download web clips not working since upgrade.

    Before upgrading to 10.6.8 I could download a YouTube clip by opening the Activity window, finding the movie file in the list and double clicking on it. Now the movie just opens up in another window but doesn'