Request For Enhancement: Add method mouseIn() to JComponent

I would like to propose that a new method be added to JComponent. This method would return boolean true if the mouse is currently over the JComponent and false if not. Method signature: public boolean mouseIn().
This method would make it easier to accomplish visual feedback for when the mouse is over any JComponent, similar to how rollover can be done for AbstractButton.
Currently, the best method I can come up with is to add a MouseListener that records the state from the mouseEntered() and mouseExited() events. I add my own method mouseIn() that returns that state. Then method paintComponent() can check this state by calling mouseIn() and paint the component accordingly.
At first I thought the MouseListener should be added in each and every constructor of each and every JComponent, but then realized actually, the place to provide this feedback is in the ComponentUI class for each JComponent, as part of a custom Look & Feel. What I have come up with is to add the MouseListener to the JComponent in the ComponentUI's createUI() method, recording the state in the ComponentUI instance. The problem with this is, it makes it impossible for the ComponentUI to be a singleton like most of the ComponentUI classes are for the standard L&F's. This requires that each JComponent instance have its own ComponentUI instance.
If JComponent had this proposed mouseIn() method, the ComponentUI methods could simply call this method, and the ComponentUI would not have to record JComponent-instance-specific state. There would not be a need for so many instances of ComponentUI and MouseListener.

Hi,
imho this request for enhancement is much better than your other onces. In fact monitoring this state is more than just using mouseEntered(..) and mouseExited(...) - if there is a method, it must return a valid state - if mouse has entered and you make the component invisible, mouse does not exit before that takes place - if you open another application which covers this component, mouse does also not exit before, but the component stays visible - you see, there are much more things to control, to get a valid state at any time. And mouseIn() is an ugly name and says less - why not isMouseOver() or something like this?
Another thing is, why do you request this for JComponent?- Should java.awt.Component not get this feature in your opinion?
greetings Marsian

Similar Messages

  • Request For Enhancement: Cell Renderers: Is the Mouse In the Cell?

    I would like to propose an enhancement to Cell Renderers: add some way for Cell Renderers to know if the mouse is currently over the cell being renderered. Currently, Cell Renderers are told only if a cell is SELECTED or has FOCUS, which are not the same thing.
    This would be of great help especially for JTable and JTableHeader, where one could provide visual feedback as the mouse moves across cells, which could be a great help for the visually impaired.

    Hi, Marsian -
    You are absolutely right about adding methods to interfaces. My mistake.
    And you are also correct that what I propose would require that cells be repainted as the mouse enters or exits that cell's bounds. If this were to prove too expensive for some applications, the JComponents that use CellRenderers could have a property to enable or disable the behavior, for example setTrackMouseMovements(boolean). But when compared to what happens when you scroll a JTable, I cannot imagine this would be anywhere nearly as expensive, and the rendering that scrolling requires--all the cells that come into view within the viewport after scrolling--seems to work just fine.
    Heck, even when you select a cell, a whole lot of cells are re-rendered. Also, when a tooltip is currently visible, if you move the mouse, the CellRenderer is consulted for each and every mouse movement, even within the same cell!!!. This seems to work fine too. Would re-rendering a cell as the mouse enters or exits its bounds by anywhere nearly as expensive?
    But you write something that still confuses me. Are you saying that you create a new Component each and every time the getXXXRendererComponent() method of your CellRenderer is called? I don't understand why one would want to do this. Can you please help me out here?
    I would think that only one instance of each Component sub-class that the CellRenderer might return would be more than good enough. And I would think that these instances would be created in the CellRenderer's constructor. Certainly, the default CellRenderer classes do not create a new Component each time a cell needs to be renderered. In fact, most of them actually extend an extension of JComponent themselves, i.e. JLabel, and return "this". No CellRenderer I have ever written has ever created a Component each time a cell is rendered. That would be very expensive.
    But still, your point about altering interfaces is well taken. Too bad.
    There must be some solution to this problem. JTable could provide the cell coordinates of the cell in which the mouse currently resides, for instance, or it could have a method that indicates if the mouse is currently over a cell with given coordinates.
    Thanks,
    ---Mark

  • Request for enhancement

    I've been using JDeveloper 9i for about 6 months now. In the beta releases there were some
    annoying bugs, but those seem to have been fixed in the final version. So now I'm mostly
    satisfied with the product. It's a great IDE with a lot of nice features. I've decided to
    use it instead of JBuilder mostly because of the price. The reason I'm posting this is that
    there are some minor things that I would like to be improved in the product. Some of them I
    consider bugs, other missing features. Hardly any of them are really serious, but they can
    get annoying when you're doing something every day. Some of these I've grown accustomed to
    in other IDEs. Maybe you've heard about some of these things before. Maybe you've already
    fixed some of them. Well here we go:
    1. It is not possible to replace text only within the selected area of a file. The replacement
    always affects the whole file.
    2. The only way to accept a suggestion from Code Insight is to press enter. It would be nice
    if you could also use the next logical operator like . (dot). Then the editor should insert the
    selected suggestion followed by . and start Code Insight again on the next level of the expression.
    3. Copying text does not always work. Sometimes I have to press Ctrl+C many times for the text
    to be copied. I have a feeling this happens when I do it too quickly. Could be a general Java bug.
    Also it seems to only happen on my home PC which is very slow (300 mHz). It's too slow for
    JDeveloper anyway, so I need a new one. JDeveloper, like all IDEs written in Java, is very
    resource intensive. I guess that's just a fact of life.
    4. I would like automatic indent after {
    5. I would like } to automatically align with the corresponding {
    6. When inserting Code Templates you have to know the exact code for a template. It would be nice
    to be able to type only part of the code and have the editor show me a list of templates whose code
    start with those characters.
    7. In the dialog box for overriding methods you have to use the mouse to check which methods to
    override. I would like to be able to use the space bar for that purpose.
    8. The dialog boxes for implementing interfaces and overriding methods do not work for inner
    classes.
    9. Code Insight does not always work. Sometimes the list of suggestions only includes classes
    and not variables and methods in the current class/method. This seem to happen only when the cursor
    is to the right of an operator, including comma. So for instance Code Insight works for the first
    argument in a method invocation, but not for subsequent arguments. And it works for the left hand
    side of an addition, multiplication etc., but not for the right hand side.
    10. When you add a new variable in the class editor, you cannot declare its type as an array.
    11. In the debugger it would be nice to have breakpoints that would fire when the value of a
    variable changed.
    12. In the debugger it would be nice to be able to evaluate and watch the result of method calls.
    13. It would be nice to have a tool to internationalise and localise an application's hard coded
    text strings.
    14. It would be nice to have numbered bookmarks in the editor. Press one key combination to set
    a bookmark and another one to jump back to that same bookmark.
    15. In the class editor there is another small problem. When you tell it to make a property bound,
    it adds the methods addPropertyChangeListener/removePropertyChangeListener/firePropertyChange and
    the variable propertyChangeSupport. This is good, but the problem is that JDeveloper doesn't look in
    the superclasses to see if they already contain these methods/variables.
    16. In the property editor you cannot set the displayed mnemonic of a JLabel to a character. You have
    to use the character code.
    17. When you edit a property in the property editor and then press enter the focus moves to the first
    property.
    18. In the property editor when you edit a property that has a drop down list of possible values, you
    cannot change the value using the keyboard (at least not by pressing enter). This may be a Java bug.
    19. In the property editor the property horizontalAlignment cannot be changed at all. For instance I
    get a message like "Field RIGHT not found in class javax.swing.JTextField".
    20. The Oracle JVM doesn't handle class and method names that use the special Norwegian characters
    with these unicode numbers: 198 216 197 230 248 229
    According to the Java standard it should, and the Sun JVM has always done so.
    21. Finally, one thing that would be really nice is for the UI editor to support visual form inheritance
    like Delphi does. I don't think any Java IDEs do, and it's the thing that I miss the most.

    16. In the property editor you cannot set the displayed mnemonic of a JLabel to a character. You have
    to use the character code. This has been fixed in the soon to be availabel release 9.0.3
    17. When you edit a property in the property editor and then press enter the focus moves to the first
    property.This has been fixed in the soon to be availabel release 9.0.3
    18. In the property editor when you edit a property that has a drop down list of possible values, you
    cannot change the value using the keyboard (at least not by pressing enter). This may be a Java bug.This is a known bug; 2157458
    19. In the property editor the property horizontalAlignment cannot be changed at all. For instance I
    get a message like "Field RIGHT not found in class javax.swing.JTextField". Works fine in the soon to be available release 9.0.3. The problem was that the SwingConstants import was not being
    added. There does remain, however, a similar bug (2337382) where constants inherited via an interface will still
    produce the same problem (e.g. setting orientation property of JScrollPane which implements SwingConstants). This
    is still sceduled to be addressed in 9.0.3.
    21. Finally, one thing that would be really nice is for the UI editor to support visual form inheritance
    like Delphi does. I don't think any Java IDEs do, and it's the thing that I miss the most. Some work has been done in this area for 9.0.3 which will improve the user experience (user will see an accurate
    portrayal of the superclass available for design, however access to inherited members is not yet ready). There still
    remains more work to do in this area that is currently scheduled for release 9.0.4..

  • Request For Enhancement: paintForeground() and paintBackground()

    I would like to propose that the paintComponent() methods of JComponent (and descendents) and the paint methods of ComponentUI (and descendents) be further broken down to call paintBackground() followed by paintForeground(), and possibly even paintBorder() and paintFocus().
    This way, the look of JComponents could be more easily customized, especially the backgrounds. As it is now, if one wishes a JComponent merely to have a textured background, for instance, the implementer is also saddled with the much more difficult tasks of dealing with Fonts, Font Metrics, Icons, Gaps, Alignments, Margins, Borders, Preferred Sizes, etc.

    Hi, Marsian -
    This is why I find this useful:
    This way, the look of JComponents could be more easily customized,
    especially the backgrounds. As it is now, if one wishes a JComponent
    merely to have a textured background, for instance, the implementer
    is also saddled with the much more difficult tasks of dealing with
    Fonts, Font Metrics, Icons, Gaps, Alignments, Margins, Borders,
    Preferred Sizes, etc.I wasn't proposing that paintForeground(), paintBackground(), etc., be
    de-coupled, i.e. separate events in the event dispatch thread
    ...sorry... I should have been more clear.
    What I had in mind was, the current paintComponent() method would be
    re-implemented to merely call, in order, paintBackground(),
    paintForeground(), paintFocus(), and paintBorder(). That way, one
    could provide an alternate implementation of any one (or more) of
    these methods without an impact on the others. As it is, if I want to
    change how the background gets painted, e.g. with a texture, I am stuck
    with dealing with the foreground as well, as I mentioned before.
    Thanks,
    ---Mark

  • Request for enhancement/extension

    Good day!
    In reply to a post I made (sore eyes), I recevied the following reply:
    Re: sore eyes
    Posted: Jun 30, 2006 1:01 PM in response to: mrmotoqvq in response to: mrmotoqvq      
         Click to reply to this thread      Reply
    Please ask the JDev guys to add the Java METAL Look and Feel to the product.
    That would fix this.
    Is this the place to ask for this?

    This is the place to ask. You can also log an ER or Bug with Metalink if you have a Database Support contract. In due course we'll be giving you access to "SQL Developer Studio", an app where you can log this kind of request.
    Regards
    Sue

  • Photoshop Elements Organizer request for enhancements

    I have two enhancements that would really make my day in Photoshop Elements Organizer:
    The first would be the ability to move and copy items from one catalog to another.  This might entail being able to have more than one catalog open at a time.  I could then drag and drop or copy an item from one to another.  I have several items in a family picture catalog that more appropriately belong in my genealogy catalog.  The only way to rectify this now is to delete from the one catalog and then recreate it in the other.
    The second would be the capability to stream albums directly to my Smart TV.  Windows Media Player can currently do this, but I would have to recreate my albums in Windows Media Player, which seems a waste of time if I have already built albums in the Elements catalog.  (There apparently is a way to do this currently using iTunes and an Apple TV device, but I would like to be able to do this directly from Elements).
    The above two enhancements would be really cool!!
    Thanks for your consideration.

    Sorry to be a wet blanket, but I really don't think Adobe will ever adopt your suggestion #1. I just don't see any interest on Adobe's part for either PSE or Lightroom to allow multiple catalogs to be in use at the same time, even though it does get requested in the 7 years or so I have been paying attention. Of course, that shouldn't stop you from submitting the feature request, that's just my observation.
    With regards to your specific situations of having a family catalog and a genealogy catalog, perhaps the workaround (and much preferred solution IMHO, which is another reason why I don't think Adobe will implement your suggestion) is to keep everything in a single catalog, with either tags or albums allowing you to segregate genealogy from family. Of course some photos might be in both; and then the problem of moving photos from catalog to catalog is eliminated.

  • How to file RFE (request for enhancement) for iPhone features?

    I have some ideas for configurability options, and want to see how I can file RFE's or see what's been filed, so I don't duplicate someone else's....

    http://www.apple.com/feedback/iphone.html
    The last think you should worry about is duplicating someone else's request. The more people request the same thing, the more priority it will likely get.

  • RFE..  request for enhancement  Unified Storage (ak)

    Hi,
    Maybe I've missed something, but is it any plans for possibility to enable krb5 as share options
    on a NFS-share? I would like to be able to do what I do on a "plain" opensolaris fileserver:
    1) uncomment krb5 lines in /etc/nfssec.conf
    2) #zfs set sharenfs=sec=krb5:krb5i:krb5p pool-0/local/filservertest/HOME
    What I'm trying to do, is denying none-kerberos-athenticated client to NFS (v4) mount anything at all.
    -espenM-
    I don't know where wlse to post this RFE....

    Espen wrote:
    I don't know where wlse to post this RFE....You should open a Service Request with Sun support. Then the support team can evaluate your request and log a RFE.

  • Request for enhancement: column(s) involved shown in constraints section

    It is not particularly important, but it's really useful and I believe it wouldn't be hard to implement.
    Tudor

    Well,
    it seems I am the only one to have such problems.
    Let's tackle the other question I left behind in my previous posting.
    I defined a query column as "display as text (based on LOV, does not save state)".
    The LOV returned roughly 7000 rows, which is the reason of the failure in the page rendering process, I got ORA-06550 and the page came out completely garbled.
    The question is, if I am not displaying a selection list, where it could be really a problem to retrieve 7000 rows, why is the process failing?
    Is it a problem of internal variable size because the results are represented as comma separated values in a big string?
    I am going to work around the problem by including the description column corresponding to the key value directly in my query, so that I do not need to pass through the LOV processing mechanism.
    Bye,
    Flavio

  • How can I request an enhancement to Thunderbird?

    I'd like to see a capability in Thunderbird that would allow user to switch on/off (ie an over-ride of current system setting) "saving a copy" at an individual e-mail level at time of creation/send of the e-mail.
    For example, my personal default setting may be "save a copy" -- but there could be many e-mails (particularly those with large attachments), or trivial content, that I really don't want/need a copy of. Would be great if I could click a "Don't save copy" button (or vice versa) at e-mail create/send time. That would obviate need to go through "Sent Mail" folder periodically deleting unwanted copies.
    Where could I request/register such a new requirement?
    Tks --- BigRinOz

    A request for enhancements (RFE) is usually posted on [https://bugzilla.mozilla.org/ Bugzilla], but in this case, I highly doubt such a feature would be added to TB. You might have more luck trying to convince an add-on developer to add the option, e.g. the author of the add-on that provides the option to delete attachments from sent messages:
    https://support.mozilla.org/en-US/questions/1018739

  • RFFOEDI1 how to generate a single spool request for payment advices

    Hello,
    We are using RFFOEDI1 to create payment idocs to send to the bank and also create payment advices.  We have multiple payment methods that we using during a single payment run.  When we run F110, the system creates the payment advices as a separate spool request for each payment method in the payment run.  The users would like to see all the payment advices in a single spool request, regardless of the payment method.  Does anyone know if SAP is capable of this?
    Thanks,
    Mark

    We are on ECC 6.0, patch level 14.
    Thanks,
    Mark

  • Enhancement request for more fine-grained templates

    JHeadstart version : 10.1.2.0
    I like to have the possibility to define templates on the level of table rows. If I am correct, currently the 'lowest' level of a .jtt template is the $FORM_ITEMS$ token. According to the userguide this token "is used to indicate the place where a form must be generated". My question is now: How can I influence this generation process? For example, I want to embed text-items within <c:if's in order to conditionally set a text-item attribute. Am I right to conclude that on this "deeper" level of a jsp (for instance table-row level), it is not possible to define templates?
    If so, I want to request an enhancement for a further 'fine-graining' of the templating technique.
    Thanks and greetings, Erik
    Message was edited by:
    ekerkhov

    Erik,
    Yes, this is not possible in he current release.
    Your enhancement request has already been implemented for the JDev10.1.3/Faces release. We will the support two kinds of tokens, one that outputs all items as it is today ($FORM_ITEMS$ or $TABLE_ITEMS$), and one token that refers to an individual item. This reference can be bpoth on index number and name:
    FORM_ITEM_1 or
    FORM_ITEM_DepartmentName
    This will allow you to layout the items exactly as you want.
    Note that in the 10.1.3 release, we will also support item-level templates where you can add code to conditonally render items.
    Steven Davelaar,
    JHeadstart Team.

  • Enhancement request for VAT Report of Customer and Vendor.

    Hello SAP Gurus,
    Have enhancement request for adding new fields in existing VAT report of Customer and Vendor like user id, GL account etc.
    As I am fresher, can you please help me that how I need to approach. Thanks for your support.
    Regards,
    Saleem

    Hello Saleem,
    Almost all fields required for VAT reporting are available in standard tax report
    S_ALR_87012357 .
    You have to configure the layout from the selection screen as below
    regards
    pb

  • Enhancement request for the jsp visual editor

    Hello -
    With respect to the visual editor, could the rendering of adf faces command buttons work the same if you use the TextAndAccessKey instead of Text to define the button text? In 10.1.3, using TextAndAccessKey will cause the buttons to render as either thin buttons without any text (but with 'normal' button height) or barely noticable 'dots' about the size of a comma. (When I see the "dots" it is usually a button in a table selection component.)
    With the buttons appearing "empty", I need to click around a bit and examine the button in the property inspector to make sure that I am working with the correct button.
    Thanks,
    -- Scott

    Hi,
    Open wss_mediumtrust.config & wss_minimaltrust.config. SharePoint 2013(C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\config\).
    Find in wss_mediumtrust.config:
    <SecurityClass
     Name="SqlClientPermission"
     Description="System.Data.SqlClient.SqlClientPermis sion, System.Data,
     Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
    Copy and paste it in to the <SecurityClasses> node of wss_minimaltrust.config.
    In the PermissionSet section of this configuration file, add the following:
    Find in wss_mediumtrust.config:
    <IPermission class="SqlClientPermission" version="1" Unrestricted="true"/>
    Copy and paste it in to the a <PermissionSet> node of wss_minimaltrust.config.
    Here is a similar thread for your reference:
    https://social.msdn.microsoft.com/Forums/en-US/a1c8f2bf-2575-40b4-87f1-4f98462b3234/request-for-the-permission-of-type-systemdatasqlclientsqlclientpermission-systemdata-version?forum=tfssetup
    Best Regards
    Dennis Guo
    TechNet Community Support

  • How to unlock the request for a report and add the same query to new reques

    hi,
         how to unlock the request for a  and add the same query to new reques

    You can unlock in SE03 tcode.
    Goto tcode SE01, give the transport number --> display --> double click on the transport --> in the next screen select all the elements --> delete --> save.
    To attach it to another transport, In RSA1, click on transport connection> Choose Object types> query elements --> here you can find your query/ or you can search, which you can drag to right and attach to the transport (using truck button).

Maybe you are looking for

  • Acrobat X Pro Error when Save As JPEG: Insufficient Disk Space to Perform Operation

    Using Acrobat X Pro when trying to save a PDF as an Image - JPEG format, the Acrobat application fails with an error: "Acrobat could not save a page in this document because of the following error: Insufficient disk space to perform the operation (Pa

  • Displaying output of sapscript

    Hi,, I had created a code in which i am displaying the output of the data in pdf format which is working fine but the thing is when i use to execut the program it display the print view in the pdf format and then ask to download which is due to the F

  • External and Portable Hard Dirves

    Could anyone tell me what they think is the best External and/or Portable Hard Drive. I have a Macbook Core Duo with 100GB of space. I have about 4GB left due to all my movies I have converted and stored on my computer, photos and music. Could anyone

  • Error in oracle.xml.sql.query

    I am trying to write small piece of code as follows import java.sql.*; import java.math.*; import oracle.xml.sql.query.*; import oracle.jdbc.*; import oracle.jdbc.driver.*; Actual Code When i try to compile the java file it errors out on Package Orac

  • Transaction code to WebDynpro application

    Hi, i want to create a webdynpro application which is started from a transaction. Has anybody an idea how the application can get information about the transaction code? Example: Transaction mm02 -> call webdynpro application, want to know which tran