SetContentAreaFilled removes focus painting

I have a JButton whose background and border I would like to be transparent/removed. However, I want to retain the focus painting for the button.
When I use setContentAreaFilled(false), the background and border are properly not displayed. However, focus is no longer painted either, even if I call setFocusPainted(true).
I even tried calling:
setBorderPainted(true);
setOpaque(false);
but as far as I can tell, these calls did nothing.
Please note that I'm using the Windows look & feel for this window, which may be the cause of the problem. However, within that context, does anyone have any recommendations for resolving this?
Thanks much!

setFocusPainted(true)
Some look and feels might not paint focus state; they will ignore this property.
So its entirely a look and feel issue, i faced the same problem once with motif look.

Similar Messages

  • [Flex 4.5.1] How to remove focus from TextInput on mouse click outside of it?

    For me clicking outside of a TextInput should always remove focus from it, only only if you click on another TextInput or Button.
    I don't see any simple event like MouseEvent.MOUSE_CLICK_OUTSIDE - which would definitely simplify things.. I wonder why there isn't such event. Well anyway I can't find any other similar event and I can't figure out an easy way to do this. I also wonder why I couldn't find a solution to this on the web easily... Well anyway...
    Does someone know how to do that in a convenient way?
    Thanks!

    ok I understand why is that. For example I have a TextInput now where the user enters number through buttons which have mouseFocusEnabled = false, so the TextInput doesn't lose focus. But on a TabBar I had to set mouseFocusEnabled = true or when I switched between tabs -> switches between states, I could still type in the TextInput in the previous tab cause it didn't lose focus. Maybe TabBar's default value of that property is wrongly set to false.
    Anyway, not losing focus when clicking outside is still weird. Take for example this forum, if I click outside of the box I am currently writing this, I lose focus. It's how things usually work. And flex focus is designed to work backwards to what people are used to, no matter as I already pointed out I understand there are cases it comes in handly. I hope I don't sound bad but take it just as a suggestion please that maybe if it is redesigned like this: clicking on component gets focus, clicking outside loses focus. But if you click on a button for example and you want to keep the focus on a TextInput cause you add some text, you should be able to set a property on the Button like maintainCurrentFocus = true (false by default), which would make clicking on the Button not shift the focus to it or set it to null if the component is a group that has some rect background for example, but maintain the focus on the TextInput.
    I could be missing something about the current design of how the focus works in flex, but from my point of view at the moment, the design I describe to use is just like how I am usually used to be working with focus as a user, not as developer.
    Maybe you could agree or maybe you know some reason by which things are how they are at the moment that I don't see. But if you think I make sense please let me know, maybe I could fill a minor enhancement request for that ?

  • How to remove focus from a Ring Control in a PDA application?

    Hello,
        In a PDA application, i have observed that when we select a pull-down Ring control, the focus is retained in the control and the text of the control appears highlighted. The only way out is to tap an empty portion of the PDA application screen to remove focus from the control. Is there any way to avoid this? Is there a method to remove focus from the control programatically?
    Note: Version of LabVIEW that we are using: LabVIEW 8.5 Professional Development System for Windows Vista/XP/2000 and LabVIEW 8.5 PDA Module for Windows Mobile.
    Thanks & Regards,
    Subhashini

    Hi Vsh,
        Thanks for ur response. Setting the key focus property node of the ring control to false removed the focus from the control. I guess it was a silly question (have started LabVIEW devp. recently).
    Thanks & Regards,
    Subhashini

  • Combobox removing focus!? help!

    Why when I use the combobox component does it remove focus
    from other movieclips?? For instance...I have a button with
    onRollOver and onRollOut functions. These work fine, but once I
    click on a combobox, they break...and won't work.
    I've looked in other places but I haven't found a fix for
    this yet. Doing setfocus(this) only puts a ugly yellow highlight
    box around my button, and then kills the swf with an infinite loop.
    Any ideas?

    hi, hold your data in a Hashtable with the value as key
    and the visible text as value,use a renderer for the combobox like here
    class MyCellRenderer extends JLabel implements ListCellRenderer {
    public MyCellRenderer() {
    setOpaque(true);
    public Component getListCellRendererComponent(
    JList list,
    Object value,
    int index,
    boolean isSelected,
    boolean cellHasFocus)
    setText(value.toString());
    setBackground(isSelected ? Color.red : Color.white);
    setForeground(isSelected ? Color.white : Color.black);
    return this;
    in the method getListCellRendererComponent you get your hashtable as object parameter,get the visible text from the hashtable and call setText (..)
    you can also make a combined String with value and text
    and take only the visible text in the renderer(this solution is not so bombastic as before)

  • Combobox removing focus?

    Why when I use the combobox component does it remove focus
    from other movieclips?? For instance...I have a button with
    onRollOver and onRollOut functions. These work fine, but once I
    click on a combobox, they break...and won't work.
    I've looked in other places but I haven't found a fix for
    this yet. Doing setfocus(this) only puts a ugly yellow highlight
    box around my button, and then kills the swf with an infinite loop.
    Any ideas?

    While it depends partly on what is outside the textfield, one way would be to add an event listener to the stage and then check what was clicked.  If it happened to be the stage, set the focus onto the stage.
    stage.addEventListener(MouseEvent.MOUSE_UP, focusStage);
    function focusStage(evt:MouseEvent):void {
        if(evt.target == stage){
           stage.focus = stage;

  • Remove focus from JButton?

    I am starting a new thread related to my previous thread.
    I came to realize that when I call a game object from the GUI menu by clicking on "New Game" button, the focus is set to the button. I found it by using the method, if(newButton.hasFocus()).
    However, my problem is not yet finished. I tried game.requestFocus(); also.
    But still, the focus is not removed.
    Can n e one pls let me know if there is a way to remove focus from the damn button?
    Thanks.                         

    button.setFocusable( false );Will pevent the button from maintaining focus.

  • Nimbus focus painting and insets

    We are still having this problem - wanted to try again on the queue.
    We have a custom table cell editor component that uses a spinner for the editor component. With Nimbus look and feel, the focus is painted around the outside of the component. However in a table cell, this focus painting (and cooresponding insets) takes up too much space. Is there a way to turn off the focus paining (or control the insets) on Nimbus for this cell editor?
    Edited by: cmildenb on Jul 9, 2012 4:44 PM
    Edited by: cmildenb on Apr 22, 2013 10:41 AM

    Try this.
    JFormattedTextField f =
            ((JSpinner.DefaultEditor) spinner.getEditor()).getTextField();
    f.putClientProperty("Nimbus.Overrides",new UIDefaults());
    f.putClientProperty("Nimbus.Overrides.InheritDefaults",false);This will essentially result in a more basic painter for the painting of the spinner's text field. So no border is painted, nor any focus (though it will still be focusable). You'll still have the nimbus style buttons of the spinner.
    Alternatively you could try a "mini" or "small" spinner.
    spinner.putClientProperty("JComponent.sizeVariant","mini");
    spinner.updateUI();

  • Is there a way to remove a painting on a wall in a shot?

    a couple walk by a wall with a painting hanging behind them. is there a way to remove it? like copy a blank space and paste it on the painting? something like that possible? do i have to go frame by frame? its like 15 total seconds...

    I agree.
    Blurring the area sounds more viable.
    Perhaps our friend might go to Andy Mees' site and download his FREE key frame-able "Andy's Region Blur":
    http://web.mac.com/andymees/Freeand_Easy/main/Entries/2008/3/19_Andy%E2%80%99s_Region_Blur3.html
    I use it all the time and it's really easy to learn.
    Andy Mees is a God.
    Best
    Harry.
    Message was edited by: Harry Davenport

  • Problem removing focused object from a table

    Hi.
    I have a problem removing a component that is focused from a table. The
    whole row is removed except a single component (JSpinner) in one row.
    My table has three columns, the first two are String fields
    (not editable) and the last is a JSpinner. Since there is no
    Default cell renderer or cell editor for JSpinner I had to
    create them.
    So, if no element of the row is focused then calling the function:
    public void clearTable() {
    setVisible(false);
    dataVector.removeAllElements(); // clear data vector
    setVisible(true);
    works just fine
    but if a spinner in a row is focused them that spinner is left alone "floating" on an otherwise empty table.
    Questions:
    1) Any one has an ideia of what might be the problem?
    2) Do I have to play with Focus to solve this? (hate the idea,
    since always been told to avoid messing with focus, because
    of the problems it normally brings)
    Thanks in advance for the help,
    Rgds,
    Jorge

    The problem is that you need to properly stop the editing operation first.if( myTable.isEditing() ) {
        // If you want to throw away any edits use...
        myTable.getCellEditor().cancelCellEditing();
        // If you want to apply any edits, then end use...
        myTable.getCellEditor().stopCellEditing();

  • Why did you remove oil paint in CC 2014?!

    I use this filter extensively in my workflow, now it is gone from the latest update to CC! This is terrible, all these wonderful new features and you remove one I use on a daily basis!
    I will keep the previous PS version for the time being.
    Anyone have any workarounds for this going forward?

    John, I was thinking more along the lines of a few versions before, not 2 months before.  In the corporate world of software engineering, you can be sure it was gone WAY before that announcement.  The stuff we consumers see released today has been finished for a long time.
    With all due respect to Adobe, sometimes even when the work gets difficult it's important to do it anyway - even if it means it will cost more or delay a release. 
    Some pointy haired boss in the past approved projects to add the Pixel Bender subsystem and the Oil Paint filter.  It was justifiable enough then to implement it where it hadn't existed before.  THAT was a long-term decision.  The product is not a fun little game for Adobe's research engineers; it's something USERS rely on; base their careers on, actually.   Okay, that may be extreme with regard to Oil Paint, but there's no denying people rely on / base careers on Photoshop as a whole.  What parts of it CAN safely be removed?
    It's a professional product, fully expected to do EVERYTHING its predecessor did - and then some.  That should be clear given all the folks scratching their heads over why CC (2014) has been released as a separate executable.
    As I have mentioned in prior discussions on this subject, people DID actually rely on Oil Paint, and not primarily for simulating fake oil paintings, which it wasn't really that good at.  There is real innovation in the way it senses edges and creates strokes that is pretty much impossible to achieve any other way.  I used it to smooth jaggies.  People used it even though the filter left a nasty 256->240 white point offset that had to be corrected afterward.
    A problem at another level - a perceptual level - is that in a couple of different ways Oil Paint added innovative "Gee Whiz" new functionality in a way that was highly interactive (GPU programming).  People noticed that.  You don't just take back out the "Gee Whiz" and call it a day, if for no other reason than it sends a message to the customers that Adobe is no longer capable of delivering "Gee Whiz".
    And that takes us to the now brutally bare bottom line:  Since no justification beyond "we outdated the tech" has been offered, Adobe really IS admitting to being incapable of maintaining that particular bit of Gee Whiz,  As flush with cash as they are with the success of the cloud model, it's clear they have chosen not to keep themselves capable of delivering it.  That's fundamentally disturbing.
    -Noel

  • Remove focus from combobox

    Hi,
    Iam working with SAP B1 2007 .
    A combobox is populated with items.After the user selects the item in it,the focus must be removed from that combobox control to next textbox control.Can anyone suggest me what can I do for this.
    Thanks In Advance

    Hi ,
    Catch the event combo select and then emulate a click on the text control
    using
    oform.Items.Item("textControl").Click
    regards
    Edy

  • Can't remove focus when validating

    I have a validation on a JTextField that stops the user focussing on the next input field until the correct data is entered. Its simple and works like this:
    private void docnumFieldFocusLost(java.awt.event.FocusEvent evt)
        if (!evt.isTemporary())
          if (!validDocnum())
           docnumField.requestFocusInWindow();
           docnumField.setBackground(new Color(251, 51, 0));
           displayMsg(errortype, title, msg);
      }One option I want to give the user is to abandon the input altogether by clicking a Reset button (to return the field to blank) or Exit button (to leave the GUI completely). But I cant get out of the original focus on the docnumField.
    I have tried:
    private void resetButtonMouseClicked(java.awt.event.MouseEvent evt)
        docnumField.setRequestFocusEnabled(false);
        docnumField.setText("");
        resetValues();
      }but the attempt to focus on the resetButton component fails because the other focus can't be broken. I would be most thankful for a suggestion to break this 'loop'.

    Did you remove camera from the multitask bar?

  • Remove Focus from Main Frame after Jinternal Frame is opened.

    Hi,
    I want to restrict the user to change any thing on main frame once the JInternalFrame is opened (you can see same effect when we execute JOptionPane where focus on main is not retain untill you close the JOptionPane).
    I have written following code to listen the JInternalFrame event
    conn_prop.addInternalFrameListener(new InternalFrameListener(){
    @Override
    public void internalFrameActivated(InternalFrameEvent e) {
    // TODO Auto-generated method stub
    @Override
    public void internalFrameClosed(InternalFrameEvent e) {
    // TODO Auto-generated method stub
    @Override
    public void internalFrameClosing(InternalFrameEvent e) {
    // TODO Auto-generated method stub
    @Override
    public void internalFrameDeactivated(InternalFrameEvent e) {
    // TODO Auto-generated method stub
    @Override
    public void internalFrameDeiconified(InternalFrameEvent e) {
    // TODO Auto-generated method stub
    @Override
    public void internalFrameIconified(InternalFrameEvent e) {
    // TODO Auto-generated method stub
    @Override
    public void internalFrameOpened(InternalFrameEvent e) {
    // TODO Auto-generated method stub
    }}); I tried setEnabled(false) but this is paralyzing entire application
    what piece of code should i write to do that........
    thanks in advance.

    That is not how a JInternalFrame is meant to be used. Read the Swing tutorial on "Using Internal Frames".
    Use a modal JDialog.

  • How do I remove leftover paint from a live paint object?

    I am trying to create my own typeface. I used live paint to paint over a grid and create letters. I'm trying to create words and the Professor wants me to eliminate any white color I may have used from white paint. I am able to show it by selecting the letter, ungrouping the object, selecting object and expand. Can you explain to me how to delete the leftover blue that don't match up with the black?

    Thank you so much! I really appreciate your help! Would it be okay if I ask you more questions?
    I was wondering could you explain to me how to make multiple rulers? I have one in light blue and I want to make another one.

  • StopCellEditing () removes focus from table

    Hi,
    i have created a custom cellEditor, when the user presses enter a popupwindow is shown which shows a list of possible values.
    When the popup closes i call stopCellEditing (), in a DefaultCellEditor the focus then remains on the table...but in this case the focus just disappears...
    Anybody with the same focusproblems?
    Nick

    Hi,
    i have created a custom cellEditor, when the user presses enter a popupwindow is shown which shows a list of possible values.
    When the popup closes i call stopCellEditing (), in a DefaultCellEditor the focus then remains on the table...but in this case the focus just disappears...
    Anybody with the same focusproblems?
    Nick

Maybe you are looking for

  • Get the region name

    Hi all, i need to get the region name for a selected page, but i don't know how to do it. Does it exist a method called 'GetRegionName' or 'GetRegionId'? Thanks bye, Simona

  • Difference between Oracle ORDM Product and Retail POS Suite

    Can someone please tell me if the Oracle ORDM Product and the Retail POS Suite by Oracle is the same or different. Regards, Akshatha

  • Rendering a composition as a PSD file?

    Hi, I was wondering if there was a way for me to render a full composition in Aftereffects as a Photoshop file (1 document) that contains all the layers?  I've searched this site as well as other forums but I wasn't able to find a solution to this is

  • Screen Failure - Reset works OK for

    Hi, I thought I'd post my experience from today as it may help others. I left my player in the car last night and when I started it this morning the screen turned on and nothing came up. It froze on me there and then and simply didn't respond to anyt

  • Add video?

    I am very new to captivate, I recorded a video from my screen, which is good. I made a 2 videos though in After Effects that I would like to add to the project as an introand an outro.. is there anyways to do this? Thanks!!