JToolTip with components in it

I want a tooltip to have a list (or basically a panel) inside it. How can I do this? I've read about including icons inside tooltips by doing icon.paintIcon but I havent had any luck doing this with JList.
So how can I include a panel in a tooltip?
thanks

Here's how you can do it:import javax.swing.*;
import java.awt.*;
public class MBTestApplication extends JFrame {
    public MBTestApplication() {
        JPanel customPanelForToolTip = new JPanel();
        customPanelForToolTip.setBackground(Color.red);  //just to prove it's there ;-)
        eJButton b = new eJButton("Click Here", customPanelForToolTip);
        b.setToolTipText("");  //just to get it to display tooltips
        getContentPane().add(b);
    public static void main(String[] args) {
        JFrame f = new MBTestApplication();
        f.setBounds(100,100,300,300);
        f.show();
class eJButton extends JButton {
    JPanel customToolTipPanel;
    public eJButton(String s, JPanel toolTipPanel) {
        super(s);
        customToolTipPanel = toolTipPanel;
    public JToolTip createToolTip() {
        JToolTip tip = new eJToolTip(customToolTipPanel);
        tip.setComponent(this);
        tip.setPreferredSize(new Dimension(100,50));
        return tip;
class eJToolTip extends JToolTip {
    public eJToolTip(JPanel customToolTipPanel) {
        super();
        setLayout(new BorderLayout());
        add(customToolTipPanel, BorderLayout.CENTER);
}

Similar Messages

  • Production order with components consumed from vendor consignment stock

    Hi expert,
    I have a production order with components and some of the components should be consumed from vendor consignment stock.
    When the order is created/released : is there  a possibility to have those components created with "special stock indicator" = 3 (consignement stock) by default?
    Thanks,
    P.

    Dear Pete,
    In my understanding it's not possible to populate this value as 3 - consignment stock in the component overview.This has to be
    done manually.
    Check in this way,by indicating a value in any of the material master field(for eg ABC indicator in MRP1 view) and if there's some
    value,then while saving the system populates for all those materials with this value as 3 by using some user exit or BADI.
    I'm not sure,it's only an idea,check and revert
    Regards
    Mangalraj.S

  • Problems with components in frames

    I have my applet (applet-application hybrid, actually) make a Frame and then add a few Components to it, like a Textfield and a Checkbox and a few buttons. On my Macintosh, everything renders fine, but in Windows, it will never draw the textfield or checkbox, only the buttons. Any idea why this is happenning? I'm sure the components are created and added and drawn in the Paint method of the frame, but they never show up and if they do they flicker on and off.
    This brings up another point that has been frustrating me ever since I started working with Components. Why can I only call setSize() or setLocation() within certain methods? To clarify, if I implement Runnable, and I try to setLocation in init(), it will fail, but in run() it works fine.
    I'm sure these are dumb questions, but from my perspective Java is doing a lot of stupid things that are merely confusing and frustrating me. It seems like once you set some attribute of an object it should remain like that. Why would the location of a checkbox or a button or a list change from init to run? It makes no sense to me and it forces me to make silly workarounds. This crap with frames and paint are so ridiculous that I can't even figure out a work around.
    Please help. I'm on the brink of scrapping this entire GUI that I've been slaving over. I'll post some cleaned up code if anyone wants to see what I'm talking about.

    Some layout managers doesn't care about setSize and setLocation is only needed when you build a GUI without a layout manager (setLayout(null)).
    And if your gui flickers, then it sounds like you are calling repaint in your paint method (that could be one cause).
    The most configurable layout manager is the GridBagLayout, but may not be easy to use if you haven't tried it before.

  • Tasklist data with components

    Hello Guys,
    I am trying to fetch the task list for headers,operations and components. Since there is no std table to retreive, I end creating query thru SQVI by joining PLMZ,PLPO,STPO to fetch the details. But I am not sure what is the connetivity between these fields to get the info. I tried with various options and no luck.
    I assume these three table will give me the info. if yes, please let me know the sequence of tables and also the link between tables to fetch only the task list associated with components.
    Mahee

    Hi,
    Take table PLMZ.
    Inputs:
    Task list type (PLNTY), Group (PLNNR)
    Get the BOM Category (STLTY) & BOM (STLNR).
    Take table STPO.
    Inputs:
    STLTY & STLNR
    Get IDNRK value MENGE (Quantity) & MEINS (UoM).
    Regards,
    Maheswaran.

  • How to prevent B1 from populating the grid with components?

    Hello group,
    We have customized a form that pops up when user enters a parent item (of a template-type BOM) in the quotation grid.  The form displays the component items and lets the user mark which items to "paste" onto the quotation.  However, B1 automatically populates the grid with the component items once focus moves away from the item code column. 
    <b>How to prevent B1 from populating the grid with components <i>while</i> retaining the parent item in the item code column?</b>  I've tried trapping the Validate event, etc. with no success.

    Instead of setting the parent item up as a template type BOM, you could set up the list of parent/child items on a user table and use this user table to display the items in your pop-up screen.  As the parent item would no longer be a template BOM, Business One would no longer automatically popuplate the grid, and you could write your own code to add only the items selected in your pop-up screen into the grid.
    John.

  • Creating BOM with components but using additional UOM

    Hi,
    I have a requirement.I want to create a BOM using componennts with their additioanl UOMs.
    Example: Parent material ABC123 UOM:EA
    Component : Test001,UOM EA,additional UOM: DZ
    Now if I am creating a BOM for ABC123 with components Test001 but overwritting the default UOM EA with Additional UOM DZ,system throws error 'Unit of measure DZ not supported for material Test001 in plant XXXX'
    I have maintained additional UOM DZ for component in material master.
    Is there any setting in the system which will allow me to use additional unit of measure for the component ?
    Please suggest
    Best Regards,
    manOO

    Hello, and I apologise if my answer is a little late, but all you have to do is maintain the production unit in the 'Work Scheduling' view of MM02.
    In the 'General Data' tab, update the 'Production Unit' field with the UOM which you would like to create the BOM.
    As long as the 'Additional Data' Units of Measure is updated in MM02 for the raw material, this should fix your problem.
    Regards
    Adam

  • Highlighting text fieldon focus with components

    Is there a way to highlight a text field when the focus is in that field. I know on a web page you can do this with JS, but wasn't sure about with AS. I am using components also.

    If you just want to highlight one word at a time then you can use:
    textComponent.setSelectionStart(...);
    textComponent.setSelectionEnd(...);
    The above code will use the default selection background/foreground font colours.
    Here is an example of a Find/Replace dialog that uses this approach.
    http://www.discoverteenergy.com/files/FindReplace.java
    If you want to get fancier and use different styles of fonts and colours for different words then you have to use JTextPane which supports StyledDocuments.
    The basic approach is to create attribute sets as follows:
    MutableAttributeSet comment = new SimpleAttributeSet();
    StyleConstants.setForeground(comment, Color.gray);
    StyleConstants.setItalic(comment, true);
    Document doc = textPane.getDocument();Insert new text into the document with the 'comment' attribute:
    doc.insertString( doc.getLength(), "comment text", comment);
    Change the attribute of existing text in the document with the 'comment' attribute:
    doc.setCharacterAttributes( 0, 3, comment, false );
    Here is a simple Java syntax highlighter that uses this approach:
    http://www.discoverteenergy.com/files/SyntaxDocument.java
    Note, most is the above code is devoted to handling multi-line comments. The main highlighting code is in the 'checkForTokens()' method.

  • Is there a simple example, I can see how to connect to a db using Flash 8 and actionscript? (not with components)

    I have been looking all over for a simple "hello world"
    example, on how to connect to a database, and pass a param, and
    return a dataset. I would like one that does not use components.
    (Actionscript only). That uses ColdFusion 7.x and Flash 8. Can
    anyone point me to one?

    Thanks Craig, I saw that example, but it was meant for Flash
    MX, and according to the Flash 8 documentation, the NetServices is
    now deprecated. Anyway, I posted my question on another site and
    some supplied me with a simple example. Here is the url if anyone
    is interested...
    sample

  • Creation of Purchase Req with components in the case of subcontracting

    Hi Frndz,
    We would appreciate if anybody can help up us in this.We are trying to build a Z-functionality to create a purchase requisition for subcontracting material (with special procurement key=30).We are able to create PR with item category "L".But the demand for components are not active.(In the item details of PR-tab:material data-)The TAB "Components" is seen.But on clicking it is not going to the items and the demand is also not created for these items.
    Can anybody tell us which is the standard BAPI for this Or is there any particular field to be passed in FM BAPI_REQUISITION_CREATE?
    Regards,
    Karthick.C

    We needed to do the same. Tried many different BAPIs and FMs, but in the end...
    we BDC'd it. Sorry.

  • Problem with components after action performed

    I am using JPanel in my JApplets and with that I am communicating the data between the my Applets (both r running in same page)I can recv my data but with that I want to add some components to the JPanel . I tried with methods repaint() update(Graphics) . still I can't achive wat I am X-pecting can any of u help me .

    I am told that the correct answer is to call
    revalidate();
    repaint(); Certainly revalidate on its own does not work for me.

  • Anyone else notice this instance bug with components?

    This seems to affect all components. It seems to work if the
    instance names are left out or if they are both the same. Try this:
    Put a button on frame 1 and a button on frame 2 (it doesn't matter
    if you duplicate the button for frame 2 or add it to a blank
    keyframe). notice the following:
    Results for Flash 9 actionscript 3
    button2 does not show up in correct x,y location but label
    updates correctly
    Results for Flash 9 actionscript 2
    button2 shows up in correct x,y location but with no label
    If the buttons are on separate layers it works fine, could
    someone explain why this is happening (what makes it work if they
    are on different layers and why they don't work if they're on the
    same layer)? I want to use the same instance name so I can
    reference the button but the x,y location of the button doesn't
    change when it should.
    Thanks!

    Yes, I noticed this the other day but didn't make a connection with the US holidays. Odd quirk.

  • Re-Rendering the entire panel with components based on list value selection

    Hi,
    I am new to swing.Wondering how to refresh the panel with modified data on selection from list.
    Here's the code I am trying .
    the function below is called withdifferent set of value s being passed in based on add,remove conditions.
    public void initGroupPanelComponents(Vector GroupListData,Object[] sourceItemsArray,Object[] sinkItemsArray)
    groupsPanel = new JPanel();
    groupsPanel.setLayout(null);
    botPanel = new JPanel(new BorderLayout());
    botPanel.setSize(500,600);
    if(sourceItemsArray.length!=0){
    sourceLabel = "New Members:";
    sinkLabel = "New Available";
    System.out.print("color change now!");
    groupsPanel.setBackground(Color.YELLOW);
    botPanel.setBackground(Color.GRAY);
    //revalidate();
    else{
    groupsPanel.setBackground(Color.BLUE);
    botPanel.setBackground(Color.WHITE);
    groupsPanel.setSize( 500, 300 );
    groupsList = new JList(groupNameListData);
    groupsList.setBorder(BorderFactory.createLineBorder(Color.gray));
    groupsList.setBounds(10,10,350,230);
    groupsPanel.add(groupsList);
    groupsList.addListSelectionListener(new groupNameListAction());
    groupsList.setListData(groupNameListData);
    addButton = new JButton("Add");
    addButton.setBounds(385,35,80, 20);
    addButton.addActionListener(new addNewGroupAction());
    removeButton = new JButton("Remove");
    removeButton.setBounds(385, 70, 80, 20);
    groupsPanel.add(addButton);
    groupsPanel.add(removeButton);
    duellist= new DualListPanel(sourceItemsArray, sinkItemsArray, sourceLabel,sinkLabel);
    botPanel.add(duellist);
    botPanel.setBounds(0, 270, 500,600);
    botPanel.setOpaque(true);
    getContentPane().add(groupsPanel);
    groupsPanel.add(botPanel,BorderLayout.SOUTH);
    getContentPane().invalidate();
    getContentPane().validate();
    setResizable(false);
    setVisible(true);
    Relevant suggestions are most welcome.
    Thanks in Advance!

    Thanks much our help.
    But,apperars to me that I have added the groupsList to the panel in the method.
    What I am trying to acheive here is, when a value is selected from the groupsList, accrodingly,in the ListActionListener, Iam trying to repaint the whole Panel with the list component above and duellist panel (a panel with 2 list components by side and buttons at the centre)obtained from dualListPanel Class .
    Appears to work fine the first time when DualListPanel is nstantiated with certain data passed in.But when a particular list value on top is selected, i would require this dualListPanel to be instantiated with a new set of data passed in.This,for some reasons fails to come up.
    Would Appreciate if you could suggest accordingly for this.
    Thanks much again!

  • Problem with components

    Hi
    I made a sample chat application with following components.
    simpleconnect, chat usercolor.
    chat component is working, it is sending and receiving
    messages.
    but when i change color in the usercolor combobox. the color
    is not reflected in the chat application.
    why , whats the problem.
    I could not understand, since one week i am struggling with
    it.
    if i run the sample_videoconference file it is working
    properly, only when i drag new components and make a new
    application , my combobox components are not responding, even
    setbandwidth combobox is also not respond if at runtime i change
    its selection.
    i need help very urgently, already i have wasted lot of time.
    thanks in advance
    regards
    avanthika

    Hi,
    I got to know where the code is not executing
    in the FCComboBox movieclip :
    FComboBoxClass.prototype.fireChange = function()
    this.lastSelected = this.getSelectedIndex();
    if (!this.editable) {
    this.topLabel = this.getSelectedItem();
    this.fLabel_mc.drawItem(this.topLabel, true);
    } else {
    this.value=this.getSelectedItem().label;
    this.fLabel_mc.setLabel(this.value);
    this.executeCallback();
    this.executeCallback() is not called in FlashPlayer 7.
    so what i did is instead of above line i have directly called
    the
    this._parent.doChange() // now each time i change the color
    in usercolor combobox it is working correctly.
    but the problem is there is one more combo box for
    setbandwidth,
    for that i have to call doSettings(comboObj);
    as these are components, for both the combo boxes the class
    file is same.
    is there any common code to replace " this.executeCallback();
    " , so that it will execute for both .
    thanks in advance
    regards
    avanthika

  • Something like a list with components... how to?

    First of all forgive me for the topic title, i couldnt find any better...
    My problem is :
    Id like to create something like a clickable list with graphics to keep trace of actives file transfers.
    In my program i used a JList with a string for each transfer but i would like to improve it, maybe adding a progress bar and some buttons to each list row.
    Is this possible?
    Thanks for the help,
    JNoobNite

    Is this possible?Nothing is impossible
    Id like to create something like a clickable list with graphics to keep trace of actives file transfers.It can be done
    In my program i used a JList So continue using a JList (well I believe it will work). Have you read up on ListCellRenderers? Here is one that allows you to have a checkbox in the JList, which can be checked and unchecked: http://www.geocities.com/icewalker2g/downloads/IconedCellRenderer.java
    i would like to improve it, maybe adding a progress bar and some buttons to each list rowUsing a JList in this case might be too much work. Instead, you could use JPanels (probably a custom class which has all the components, ie buttons, progressbars, icons, and then use some kind of model architecture to manage them ie, retrieve, remove, add, etc. This should allow you to easily interact with the components.
    That's my 3 and a half cents
    ICE

  • No scroll with components with 100% layout

    I've imported a project depeloped in Flex Builder 2.0 into
    Flex Builder 3.0. I have mxml components based con canvas whose
    layout is 100% width and 100% heigth. When I open one of these
    components in Flex Builder 3 there is no scroll bars in the design
    view, so there's no way to work with the controls that not fit en
    the view window. This doesn't hapend with Flex Builder 2.0.
    Thank you

    Speaking of this, the design area dropdown seems to disappear
    randomly for no apparent reason. I've never actually seen it
    disappear, so I don't know what's causing it, I just know that when
    I open a file its there, then if I work on it for more than 5
    minutes or something its gone, and I have to close the file and
    reopen it to bring it back. I can't figure out why the dropdown
    would just disappear, and its frustrating to have to close and
    reopen a file everytime I want to resize the design area.

Maybe you are looking for

  • Running Final Cut Pro on 1280 X 720, 60 Hz, Millions

    I just updated to Final Cut Pro Suite 2 but Final Cut Pro, Compressor, & DVD Studio Pro wont open with my display selected to 1280 X 720, 60 Hz, Millions. It demands that I have it set to 1024 X 768, 75 Hz, Millions, which looks like trash. Anyone ti

  • SQL query using lot of Temp space

    I have sql query which is using lot of temp space , please suggest some ways to reduce this SELECT A.POSITION_NBR, TO_CHAR(B.EFFDT,'YYYY-MM-DD'), rtrim( A.SEQNO), A.EMPLID, B.REG_REGION, A.MANAGER_ID, A.REPORTS_TO, case when A.POSITION_NBR = A.REPORT

  • DEFAULT OPEARTION IN PRODUCTION ORDER

    guru, we do not have routing for material , we want default in production order generation, how it is possible with spro setting? basu

  • Want a FaceTime Handle

    I want a FaceTime name, or handle, I can publish on business cards and such. Skype gives you a handle but who wants to use Skype on apple devices? Not me. I've read about controlling your FaceTime caller ID. You can control which phone number or emai

  • MM: Purchasing- Contract value reduced after Po creation.

    Dear All, I have scenario where the contract has value of 1000 $ and PO created for 1000$ somebody from procurement goes and changes the contract value to 900$. System allowed to do so without any warning or error message though the entire amount is