How to realize the functionality like the JLayer in Swing?

JLayer in Swing is a decorator for Swing components. It enables us to draw on components and respond to component events without modifying the underlying component directly, which is interesting  to me. How to do that in JavaFX?

Technique Description - Use a StackPane
For simple layering, wrap the underlying node in a StackPane and add further nodes to the stackpane to layer them on top.
One technique is to just use two nodes in the StackPane, the original node and a Pane on top the original node.  Because the Pane is a automatically resizable Node, the Pane size will adjust to completely cover the Node below. By setting the pickOnBounds and mouseTransparent properties of the Pane appropriately, you can decide whether you want to top pane to consume all mouse events, consume only mouse events on the areas where the top Pane is not transparent and let the rest pass through to the underlying node or let all mouse events be handled by the underlying node.  The top pane is sometimes known as a glass pane.
Links to examples which use the described technique
A very simple example with no input processing is =>
javafx 2 - How to implement a transparent Pane with non-transparent children? - Stack Overflow
A more comprehensive demonstration of the technique is han solo's blog post on using a glass pane for processing =>
http://harmoniccode.blogspot.com/2013/04/validate-it.html
For a supported library by a commercial company see the Decoration Utilities from JideFX =>
Highlights of the JideFX Beta Release (2 of 3) | David Qiao's Blog
Suggested Approach
If you just have one-off requirements than rolling your own like in the StackOverflow answer or han solo's blog is the way to go.
If you have more sophisticated requirements, you should look into JideFX (it is an open source library).
And I hope I've got this answer right because I've never used JLayer in Swing, but it appears similar to what I have described.

Similar Messages

  • How to realize the screen-word identification?

    hi ,i am a chinese ,now i am doing a practical software which is named the base-on-pc electron dictionary ,and there is a necessary function which demands that when you move your mouse onto a word ,then ,at once ,there will come out a frame which shows the meaning of the world ,but i don't know how to realize the screen-world identification?
    is there anyone can help me ? god bless you !

    if you are using swing:
    - get mouse pointer screen location
    - get frame/window components and iterate recursively until you find the component
    - depending of the component you must to use some of its method to search de word, p.e
    - then you can obtain the definition and show a tooltip
    but think:
    - this solution is bounded to your app
    - it's no generic, you must define the "searchable" components and code it
    There area another more generic solution(and difficult, and interesting), if i remember right, the app babylon dictionary works capturing the area of the screen at the mouse pointer and then appling OCR technics to recognoice the word... it was good!

  • How to realize the internal frame as in Swing?

    How to realize the internal frame as in Swing? JavaFX has the similar function?

    For system tray in JavaFX 2.2, you need to use AWT, see =>
    Re: How to call Stage’s show/hide methods from AWT-thread
    http://docs.oracle.com/javase/tutorial/uiswing/misc/systemtray.html
    awt - JavaFX app in System Tray - Stack Overflow

  • How to realize the other three events triggered by a sequence of events occurs?

    How to realize the other three events triggered by a sequence of events that occurs between Labview, and the time interval between three events for the 50ms?
    1110340053

    Are you another student who feels the need to post their "student ID" number as a part of the message?  There is really no need to do that, it is meaningless to us.
    You should ask your instructor to answer your questions rather than allowing them to turn the whole class of students loose on the forums usually asking the same identical question.
    At least in your case, the question is different from most we've seen.  Unfortunately, you haven't asked a clear enough question for us to understand what you are talking about.
    What "events" are you talking about?  Post a VI that demonstrates the code that you have written so far.

  • How to realize the referenced in the BI, similar to EXCEL "vlookup" mode

    HI,experts:
    My  webi 4.0
    Data and  Logical following:
    DIM(dimnesion):
    one Query is
    [dimA]  [dimB] [dimC]  [dimD]
    New  add Query is
    [dimA]  [Class1]
    the two Query are Different  universe model .
    THE dimA  is the same data content.
    I want to achieve the effect of the following:
    [dimA]  [dimB] [dimC]  [dimD]   [Class1]
    Error occurred:   #DATASYNC   and    #CONTEXT (Screenshot)
    How to realize the referenced in the BI, similar to EXCEL "vlookup" mode?

    I get it.thanks
    The solution is set up  detail variable
    Screen Shot
    Regards
    wang

  • How to realize print function in JSP

    How to realize print function in JSP? I know use Javascript:window.print() can print,but it will print whole page,it don't fit me;Another method is to write JSP into Excel and then print it in Excel,but it don't fit me too,because it don't print directly. Anybody know how to print it directly?

    Many websites offer a "printer friendly" version of a certain page. That IMO is the only way to solve your problem, next to using CSS to use a different style for printer output. Here is a tutorial that covers this:
    http://www.alistapart.com/stories/goingtoprint/

  • How to realize the login function in adf

    i am a fresh man,knows little about adf.
    I know how to pass the user's input to managed bean,as below:
    <af:dialog id="d2" affirmativeTextAndAccessKey="login"
    cancelTextAndAccessKey="cancel"
    dialogListener="#{login.handleLogin}" type="okCancel">
    <af:inputText label="Label 1" id="it1"
    value="#{login.user}"/>
    <af:inputText label="Label 2" id="it2"
    value="#{login.password}"/>
    </af:dialog>
    but how can i get the user informantion like username,password from database in the following method of the bean class:
    public void handleLogin(DialogEvent dialogEvent)
    if(dialogEvent.getOutcome() == DialogEvent.Outcome.ok)
    //here i should get user information from database, but how?
    before, i can build the connection object and statement object myself. In adf, I don't know where to begin.

    Hi..
    To create application with inbuilt authentication you can use jazn-data.xml, Here you can define user roles and users etc.
    See:
    try [http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtAnchor.BGBGJEAH/vtTopicFile.adfdevguide|adding_security~htm/]
    JDev 11g ADF Security app on standalone WLS against Active Directory
    http://kr.forums.oracle.com/forums/thread.jspa?threadID=603703

  • How to realize the "save as" dialogue box?

    I want to realize this function in my jsp page:
    when I click a button, the system can prompt a new dialogue box which is the same as
    the "save as" dialogue box in windows 2000.
    How to realize it? Can I use JavaScript?

    You are asking about something that happens at the browser, so the question is identical to the one that asks how you can do it in HTML. But what do you expect to save with this dialogue box?

  • How to realize the process for having "bottle-washing" service outside

    Dear Gurus,
    Here in our company, we would like to realize the below process in SAP.
    1. We create a Purchase Order(PO) to buy some bottles from the supplyer. (PO Creation)
    2. The supplyer delivers the bottles as per the PO and we receive them. (Post Goods Receipt)
    3. These bottles need to be washed up once we receive them. So we store them as blocked stocks.
    4. In order for the bottles to be washed, we will create another PO to have the bottles washed by the service vendor. (PO Creation)
    5. At the same timing, we pick up those bottles and send the bottles to the service vendor. (Post Goods Issue)
    6. The service vendor washes all the bottles and send them back to our company and we receive them. (Post Goods Receipt)
    7. Once we receive them, we will keep them as unrestricted stocks.
    Number 1 to 3 are nothing but normal process.
    But from 4 to 6, I would like to know how to do so...
    I am assuming the PO to service vendor should be sub-contract one, but in this case the BOM should be recurrsive, because what we send to the service vendor and what we receive are exactly the same bottles, aren't they?
    And since this is just for having outsourced service, we only want to pay for the service itself, not for the price of the bottles.
    Hence I am wondering how to avoid having the bottle price in the condition view and also how to include service price for washing and shipping cost. Do we have to maintein service master for it?
    Please advise me to have those process in our SAP system, hopefully step by step.
    Thank you very much for your support in advance!

    hi dear
    with MM module are you using PP module ?
    if so with the help of control key (PP02) in routing (external activity) you can send and receive materials and respect to that Pr PO will raised as per operations.

  • How to realize the init-update command in APDU?

    I want to communicate with the card without JCOP IDE but my own program. So I face a problem, there is no APDU for set-key, So I don't know how to change the init-update and ext-auth command to APDU. Does anyone have some experience on that. Please give me some suggestion. Thank you in advance!

    set-key is not a apdu command. In JCOP tools it is just a script command to realize the IDE what keys are going to use in GP authentication. Use the keys to generate cryptograms which is needed in Init-Update and Ex-Auth.
    Go to the following thread:
    http://forum.java.sun.com/thread.jsp?forum=23&thread=395983

  • (MHDDK) How to realize the synchronization of read and write for long time by cart PCI6025E

       I've finished the programming of the process read and write for the PCI6025E, I can read and write the data now, I wanna synchronize both of the processes, writing the data into the card just after the reading from the card, and check the wave in the oscilloscope. when I use the SEC , it works, but when I changed to MSEC, the wave only come out for a few seconds, even if I bloc 60sec, and also the wave is not steady. why?
         so now the problem is how could I write the data immediately which just read and it's for a long time I asked?
    Thanks in advance!

    Hi Jack,
    aiex4.cpp doesn't exist, as far as I can tell. I believe that while the examples were being named, the developer mis-numbered them and just skipped 4 :-S
    At any rate, if you already have AI and AO working separately, and you have the I/O performance you application requires, then you may not need to add DMA to your driver. However, if you want to add DMA, it won't be very difficult. In essence, you would need mix code from the S and M Series examples. The S Series example aiex2.cpp shows two things: the few lines of code you need to add DMA objects (lines 70-78), and how to program the STC to use DMA (line 114). And aiex3.cpp from the M Series examples gives a clearer picture of how to control and read the DMA channel.
    Thanks, Rolf, for your time and help :-) I'm grateful for your contributions, and I'm glad to see active developers in the DDK forum.
    Joe Friedchicken
    NI VirtualBench Application Software
    Get with your fellow hardware users :: [ NI's VirtualBench User Group ]
    Get with your fellow OS users :: [ NI's Linux User Group ] [ NI's OS X User Group ]
    Get with your fellow developers :: [ NI's DAQmx Base User Group ] [ NI's DDK User Group ]
    Senior Software Engineer :: Multifunction Instruments Applications Group
    Software Engineer :: Measurements RLP Group (until Mar 2014)
    Applications Engineer :: High Speed Product Group (until Sep 2008)

  • How to call C++ function like this...

    hi!everyone!
    i have a C++ function like this:
    java_call_c::test()
    how do i write codes in java in order to call the function ???
    thanksa lot !!!

    Actually there is no way to write C code with C++ functions (as well as you can't call Pascal functions).
    But you can create function in C style to call C++ function.
    void test( )
      java_call_c c = new java_call_c( );
      c->test( );
      delete c;
    }:)

  • Wireless keyboard operation on ipad - how to handle touch functions like email garbage can?

    Received gift of wireless keyboard for my ipad. Managed bluetooth pairing and am stumped on functions other than simple typing. Can any keys be used for functions like the garbage can in email?

    As far as I know it just replaces the onscreen keyboard, the iPad is a touch device and you will need to touch the screen for some things. The function keys for display brightness control, iPod and volume control also work.

  • How to better the performance while Swing??(urgent)

    Hi all,
    I am working on a product where there are many applets embedded within the JSPs.So each time when the user go out and again come back to the page,the applets are getting loaded after taking a lot of time(almost 30-40secs).Do please note that all these applets contain a lot of UI controls which would be populted by the user.
    Please tell me how to improve the performance of these applets by holding the data once entered by the user.
    thnx & rgds,
    balan_v

    hi,
    One way is to use jar files, Once the jar files are installed on the client machine they dont need to be downloaded every time.

  • How to improve the Performance of Swing Components

    Hi
    I have developed a GUI Framework with Swing components. I observed that when number of components are more, the GUI is slow. Could anybody suggest me the ways to improve the performance of Swing Components
    Thanks

    Hi There - I haven't found issues so far with the speed of the GUI building, it seems fast when compared with .NET applications
    Are you doing any database querying on form load? This can slow down the loading of the GUI, I use persistence in an application and before the GUI is shown the persistence unit logs in to the database and registers itself - it does take 2/3 seconds to register and complete whatever it does before the form builds and shows
    Also check if you are loading/using any network based files on form load, this can also slow down the building considerably as well. Apart from that it's hard to say where your issue may lie apart from removing controls and checking build speed until you find the one that's slowing it down (not a good approach though) I sometimes had to load csv files from a network drive and if the file server is slow or LAN speed isn't great this can also cause a delay, hope you find it.....

Maybe you are looking for