Checkbox with mouseover info in apex?

Does APEX have an library or function in javascript to show at a checkbox a mouseover?
I need an info when someone is scrolling above a checkbox element.
At the moment iam trying overlib, does anyone has experience with overlib and apex?

Without going to all the effort of using javascript, can't you just add a title="info" attribute in the checkbox HTML Form Element Attributes?

Similar Messages

  • Migrating Forms with User-Info to Apex

    Hi,
    i am using forms with CLIENTINFO-Bean (javabean running in forms9), to save who (OS-Username, e.g. windows user), where (workstation-name and ip-address) modified records.
    I wonder if its possible to get similar functionality within apex? I assume this cannot be achived with javascript - just with a java app?
    any help would be appreciated. i would really like to migrate this app to apex...
    kind regards
    Günther

    Hello Günther,
    If relevant you could dive into [NTLM Aiuthentication|http://jastraub.blogspot.com/2008/03/ntlm-http-authentication-and.html].
    APEX is a browser app and can even run on a mobile phone, and there is no os-user on an iPhone I guess.
    In a IE environment you can get the username using an ActiveX object, but a user has to accept running such an object...
    You could also go for an SSO / LDAP solution so your :APP_USER = OS Login.
    I'm afraid it won't get better than that....
    Greetings,
    Roel
    http://roelhartman.blogspot.com/

  • Checkbox with submit

    Hi,
    Is there checkboxes with submit/redirect in APEX 3.2 / 4.0? I'm using 3.0 and there's no option :(
    Is there an alternative I can do? Maybe something like Form Element Option Attributes - onclick=refresh()/reload() except I need it to recognise in the session that the checkbox is selected (it remains selected with some options but item conditions dont occur and it doesnt recognise the checkbox's value in the session section.
    Mike
    Edited by: Dird on May 7, 2010 2:38 PM

    Hi Mike
    onclick=doSubmit('YOUR_REQUEST_VALUE');In the HTML Form Element Attributes should do it.
    I don't know about 4.0 but it's not in 3.2.1.
    Cheers
    Ben

  • I purchased a used 2008 iMac. And although the previous owner said he deleted all of his information his iCloud account is still the primary. I don't have a clue about what to do about it. I signed him out and logged in with my info, but still no go.

    I purchased a used 2008 iMac. And although the previous owner said he deleted all of his information, his iCloud account is still the primary. I don't have a clue about what to do about it. I signed him out and logged in with my info, but still no go. Is there any way to eliminate his iCloud account and make mine the primary without rebooting it back to factory settings? There was an update, I believe, that I couldn't install because i didn't have his password that is what made me aware that his acct. was still active. I don't know what to do. Any help is greatly appreciated. Thank you.

    Before buying a second-hand computer, you should have run Apple Diagnostics or the Apple Hardware Test, whichever is applicable.
    The first thing to do after buying the computer is to erase the internal drive and install a clean copy of OS X. You—not the original owner—must do that. Changes made by Apple over the years have made this seemingly straightforward task very complex.
    How you go about it depends on the model, and on whether you already own another Mac. If you're not sure of the model, enter the serial number on this page. Then find the model on this page to see what OS version was originally installed.
    It's unsafe, and may be unlawful, to use a computer with software installed by a previous owner.
    1. If you don't own another Mac
    a. If the machine shipped with OS X 10.4 or 10.5, you need a boxed and shrink-wrapped retail Snow Leopard (OS X 10.6) installation disc from the Apple Store or a reputable reseller—not from eBay or anything of the kind. If the machine is very old and has less than 1 GB of memory, you'll need to add more in order to install 10.6. Preferably, install as much memory as it can take, according to the technical specifications.
    b. If the machine shipped with OS X 10.6, you need the installation media that came with it: gray installation discs, or a USB flash drive for a MacBook Air. You should have received the media from the original owner, but if you didn't, order replacements from Apple. A retail disc, or the gray discs from another model, will not work.
    To start up from an optical disc or a flash drive, insert it, then restart the computer and hold down the C key at the startup chime. Release the key when you see the gray Apple logo on the screen.
    c. If the machine shipped with OS X 10.7 or later, you don't need media. It should start up in Internet Recovery mode when you hold down the key combination option-command-R at the startup chime. Release the keys when you see a spinning globe.
    d. Some 2010-2011 models shipped with OS X 10.6 and received a firmware update after 10.7 was released, enabling them to use Internet Recovery. If you have one of those models, you can't reinstall 10.6 even from the original media, and Internet Recovery will not work either without the original owner's Apple ID. In that case, contact Apple Support, or take the machine to an Apple Store or another authorized service provider to have the OS installed.
    2. If you do own another Mac
    If you already own another Mac that was upgraded in the App Store to the version of OS X that you want to install, and if the new Mac is compatible with it, then you can install it. Use Recovery Disk Assistant to prepare a USB device, then start up the new Mac from it by holding down the C key at the startup chime. Alternatively, if you have a Time Machine backup of OS X 10.7.3 or later on an external hard drive (not a Time Capsule or other network device), you can start from that by holding down the option key and selecting it from the row of icons that appears. Note that if your other Mac was never upgraded in the App Store, you can't use this method.
    3. Partition and install OS X
    a. If you see a lock screen when trying to start up from installation media or in Recovery mode, then a firmware password was set by the previous owner, or the machine was remotely locked via iCloud. You'll either have to contact the owner or take the machine to an Apple Store or another service provider to be unlocked. You may be asked for proof of ownership.
    b. Launch Disk Utility and select the icon of the internal drive—not any of the volume icons nested beneath it. In the  Partition tab, select the default options: a GUID partition table with one data volume in Mac OS Extended (Journaled) format. This operation will permanently remove all existing data on the drive.
    c. An unusual problem may arise if all the following conditions apply:
              OS X 10.7 or later was installed by the previous owner
              The startup volume was encrypted with FileVault
              You're booted in Recovery mode (that is, not from a 10.6 installation disc)
    In that case, you won't be able to unlock the volume or partition the drive without the FileVault password. Ask for guidance or see this discussion.
    d. After partitioning, quit Disk Utility and run the OS X Installer. If you're installing a version of OS X acquired from the App Store, you will need the Apple ID and password that you used. When the installation is done, the system will automatically restart into the Setup Assistant, which will prompt you to transfer the data from another Mac, its backups, or from a Windows computer. If you have any data to transfer, this is usually the best time to do it.
    e. Run Software Update and install all available system updates from Apple. To upgrade to a major version of OS X newer than 10.6, get it from the Mac App Store. Note that you can't keep an upgraded version that was installed by the original owner. He or she can't legally transfer it to you, and without the Apple ID you won't be able to update it in Software Update or reinstall, if that becomes necessary. The same goes for any App Store products that the previous owner installed—you have to repurchase them.
    4. Other issues
    a. If the original owner "accepted" the bundled iLife applications (iPhoto, iMovie, and Garage Band) in the App Store so that he or she could update them, then they're irrevocably linked to that Apple ID and you won't be able to download them without buying them. Reportedly, Mac App Store Customer Service has sometimes issued redemption codes for these apps to second owners who asked.
    b. If the previous owner didn't deauthorize the computer in the iTunes Store under his Apple ID, you wont be able to  authorize it immediately under your ID. In that case, you'll either have to wait up to 90 days or contact iTunes Support.
    c. When trying to create a new iCloud account, you might get a failure message: "Account limit reached." Apple imposes a lifetime limit of three iCloud account setups per device. Erasing the device does not reset the limit. You can still use an iCloud account that was created on another device, but you won't be able to create a new one. Contact iCloud Support for more information. The setup limit doesn't apply to Apple ID accounts used for other services, such as the iTunes and Mac App Stores, or iMessage. You can create as many of those accounts as you like.

  • I can no longer edit song and album information in iTunes. I right click on the album, the window opens with "get info", "rating", etc., but none of it operates. What did I change to make it stop working?

    I can no longer edit album or song information in iTunes. I right-click on the album (or song), and the window opens with "get info", "rating", etc., but none of it operates. It won't get or save album art, anything. What have I changed to make it all stop working?

    You are describing an iTunes problem, not an iPod touch problem. Try posing in the iTunes forum.

  • Importing MS Word into PDF adds extra page with document info

    I am still evaluating Acrobat Pro, including Life Cycle Designer to create Forms, currently testing converting existing forms made in MS Word to PDF. There is someting that I do not know how to resolve is when I import files from MS Word, an extra page with details info about the document is copied as well. It contains info such as number of pages, author, date of creation etc....20 lines of info.
    This becomes akward when inserting the document into an existing pdf...or just create a new form from the Word document....adds the extra page ..
    Is there a setup somewhere that I could modify to not have the extra info? or how do I delete it? I try to select the text but cannot (within life cycle)
    Thank you

    If you are importing into Designer, you should ask in that forum. If in Acrobat, then you might try printing the WORD document to a PDF first and importing the PDF. However, with Acrobat you will not get the form fields that you are preserving with Designer.

  • [repo_proxy 13] SessionFacade::openSessionLogon with user info has failed(Transport error: Communication failure.

    Post Author: LeeCUK
    CA Forum: Authentication
    I have installed Enterprise XIR2 onto a Windows 2003 server and all services are running.I have installed the client on another windows 2003 server and I can connect to the console via the web.
    Firstly desktop intel would not work and gave me the error below, however a new entry appeared in my server dropdown with servername (.Net Portal) and after selecting this Desktop intell worked.
    When I try to run designer I dont get the extra server in the dropdown nor does it connect when tryped manually and gives me the same error I was getting for desktop intel.
    Im using enterprise authentication
    Has anyone figured this out please?
    The error im getting is below[repo_proxy 13] SessionFacade::openSessionLogon with user info has failed(Transport error: Communication failure.(hr=#0x80042a01)

    Post Author: jsanzone
    CA Forum: Authentication
    LeeCUK:
    The &#91;repo_proxy 13&#93; error seems to be a catch-all for BO in that I've worked with this software (XI R2) for 1 1/2 years now and each time I've encountered &#91;repo_proxy 13&#93; it has been for a different reason, thus, you're going to have to apply troubleshooting checks all over the place until you find the problem. In my particular case I just resolved my &#91;repo_proxy 13&#93; error I've been working on this week, and here was my scenario.  Our server in the lab died due to a hard drive failure, so we cut our losses and installed a new & more powerful server.  When the rebuild was done I could not connect from my laptop to the repository via Designer (good old &#91;repo_proxy 13&#93; error).  After much angst, etc, etc I found out that the servers in the CMC (/businessobjects/enterprise115/admin/en/admin.cwrwere"&gt;http://<server>/businessobjects/enterprise115/admin/en/admin.cwrwere) were all down except for one (even though CCM showed all servers "up").  When I went to start the servers in the CMC I was prompted for an account, and no matter what account I tried it won't work.  So I went back to the CCM servers and stopped them all, then changed the default account it was using from LocalSystem to the administrator account, restarted all servers in CCM, went back to CMC and noted that all servers were now up as well.  Then I went back to my laptop and used Designer and was able to successfully log in.  Thus, the end of my story, however, it seems that many &#91;repo_proxy 13&#93; errors have different beginning and endings.  For instance, a year ago I had the same &#91;repo_proxy 13&#93; error and brought it to BO tech support.  They determined that I had to uninstall my client from my laptop, clean out the registry for any references to BO keys, and remove the c:\program files \Business Objects  folder, then reinstall, and sure enough it worked in that case, but not in this case when I tried it again.  By digging deeper I found out the root cause to my current problem, and voila, I'm in!
    Good luck!

  • How to checking my checkbox with a listbox

    I have a new form where I would like to check automatically my checkbox with a choice from listbox.
    I have a listbox with three values in french "Utilisateur" - "Comptable" and "Membre direction".
    I would like when the user has selected "Utilisateur", my checkbox with value "OJV_OFFICE_UTILISATEURS" has checked or "Comptable" checkbox with value "OJV_OPF Caissiers"
    Can you help me.
    Thanks

    Look at this previous post:
    https://forums.adobe.com/thread/1506686
    To modify the script to your form, you could try this as the custom validation script for your combo box:
    if (event.value=="Utilisateur") {
    this.getField("OJV_OFFICE_UTILISATEURS").value = "Yes"; 
    this.getField("OJV_OPF Caissiers").value = "No";}
    else if (event.value=="Comptable") {
    this.getField("OJV_OFFICE_UTILISATEURS").value = "No"; 
    this.getField("OJV_OPF Caissiers").value = "Yes";}
    Make sure you have the "Commit selected value immediately" option selected.

  • InDesign 5.0 tools/panels not activated with mouseover/mouseclick

    The following summarizes the hardware, software, procedures and results in my attempt to resolve issues with InDesign 5.0. Suggestions would be appreciated. Thanks!
    System:
    HP EliteBook 8540W
    Intel Core i7 CPU  Q820 @ 1.73GHz 1.73 GHz
    8 GB
    64-bit Operating System
    Pen Input Available
    Wacom Intuos4 pen and mouse
    Adobe Products:
    Adobe Creative Suite 5 Master Collection, Version 5.0
    Acrobat 9.4.6
    Procedure:
    The computer system control panel > program uninstall was used to clear all Adobe products except Acrobat, AIR, Flash Player and Media Player. The Adobe CS5 Cleaner Tool for Windows was installed and run at Clean All to remove all products and installer-related files for the Creative Suite 5.0.
    The Creative Suite 5.0 was re-installed on the HP cpu using the registered program discs.
    The Adobe 7_0_4 InDesign Patch-All was downloaded from Adobe and installed.
    Result:
    Tools Panel: Selection Tool and Direct Selection Tool will not highlight with mouseover nor activate with mouseclick.
    Layers Panel: Can't click-on Layer Name to activate that Layer; individual Layer Names can't be double-clicked to rename; visability can't be toggled with mouseclick; the Create New Layer icon at bottom of panel can't be activated with a mouseclick; a New Layer can be created from the Panel upper dropdown menu; Panels location can be moved, panels opened/closed, and collapsed with mouseclick.
    Character Panel: None of the Character styling dropdowns within the panel can be activated; Character styling options can be activated from the upper right panel options triangle dropdown, and they can be activated from the Application Bar: Type > Font and Type > Size. In the Type > Font flyout panel displaying all fonts, the mouse wheel will not scroll through the fonts.
    Paragraph Panel: Can't click on paragraph alignment option icons.
    Links Panel: In Pre-flight, can't activate link list item with mouseclick.
    Stroke/Color/Swatch Panels: Can't activate any tools within these panels with mouse.                             

    Peter,
    Thank you very much. I re-set DPI to default, rebooted, and the issues I was experiencing with InDesign were gone.
    Brad

  • I'm converting from a PC to  iMac. On the PC I have many Inbox folders with PR info for distribution. How do I get these folders from the PC to the iMac?

    I'm converting from a PC to  iMac. On the PC I have many Inbox folders with PR info for distribution. How do I get these folders from the PC to the iMac? I've used the Windows e mail Inbox folders for an easy access filing cabinet for years, as this all goes out on e mail. Thanks for assisting me!

    I think the easiest way would be to use Migration Assistant to get all that over...
    http://support.apple.com/kb/HT2518
    http://support.apple.com/kb/DL1415

  • Full Export/Import Errors with Queue tables and ApEx

    I'm trying to take a full export of an existing database in order to build an identical copy in another database instance, but the import is failing each time and causing problems with queue tables and Apex tables.
    I have used both the export utility and Data Pump (both with partial and full exports) and the same problems are occurring.
    After import, queue tables in my schema are unstable. They cannot be dropped using the queue admin packages as they throw ORA-24002: QUEUE_TABLE <table> does not exist exceptions. Trying to drop the tables causes the ORA-24005: must use DBMS_AQADM.DROP_QUEUE_TABLE to drop queue tables error
    As a result, the schema cannot be dropped at all unless manual data dictionary clean up steps (as per metalink) are done.
    The Apex import fails when creating foreign keys to WWV_FLOW_FILE_OBJECTS$PART. It creates the table ok, but for some reason the characters after the $ are missing so the referencing tables try to refer to WWV_FLOW_FILE_OBJECTS$ only.
    I am exporting from Enterprise Edition 10.2.0.1 and importing into Standard edition 10.2.0.1, but we are not using any of the features not available in standard, and I doubt this would cause the issues I'm getting.
    Can anyone offer any advice on how I can resolve these problems so a full import will work reliably?

    Thanks for the lead!
    After digging around MetaLink some more, it sounds like I'm running into Bug 5875568 (MetaLink Note:5875568.8) which is in fact related to the multibyte character set. The bug is fixed in the server patch set 10.2.0.4 or release 11.1.0.6.

  • Checkbox with JTree

    hai,
    i added checkbox to each tree node and my coding is
    import java.awt.BasicStroke;
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.ComponentOrientation;
    import java.awt.Dimension;
    import java.awt.FlowLayout;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.GridLayout;
    import java.awt.Insets;
    import java.awt.Point;
    import java.awt.Rectangle;
    import java.awt.RenderingHints;
    import java.awt.Toolkit;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.FocusEvent;
    import java.awt.event.FocusListener;
    import java.awt.event.InputEvent;
    import java.awt.event.KeyEvent;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseMotionListener;
    import java.util.Arrays;
    import java.util.HashSet;
    import java.util.Iterator;
    import java.util.Set;
    import javax.swing.AbstractAction;
    import javax.swing.AbstractButton;
    import javax.swing.Icon;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JCheckBox;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.JTree;
    import javax.swing.KeyStroke;
    import javax.swing.SwingUtilities;
    import javax.swing.UIManager;
    import javax.swing.UnsupportedLookAndFeelException;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeCellRenderer;
    import javax.swing.tree.TreeCellRenderer;
    import javax.swing.tree.TreePath;
    /** Provides checkbox-based selection of tree nodes. Override the protected
    * methods to adapt this renderer's behavior to your local tree table flavor.
    * No change listener notifications are provided.
    public class CheckBoxTreeCellRenderer implements TreeCellRenderer {
    public static final int UNSELECTABLE = 0;
    public static final int FULLSELECTED = 1;
    public static final int NOTSELECTED = 2;
    public static final int PARTIALSELECTED = 3;
    private TreeCellRenderer renderer;
    public static JCheckBox checkBox;
    private Point mouseLocation;
    private int mouseRow = -1;
    private int pressedRow = -1;
    private boolean mouseInCheck;
    private int state = NOTSELECTED;
    private Set checkedPaths;
    private JTree tree;
    private MouseHandler handler;
    /** Create a per-tree instance of the checkbox renderer. */
    public CheckBoxTreeCellRenderer(JTree tree, TreeCellRenderer original) {
    this.tree = tree;
    this.renderer = original;
    checkedPaths = new HashSet();
    checkBox = new JCheckBox();
    checkBox.setOpaque(false);
    System.out.println(checkBox.isSelected());
    checkBox.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
              trace(checkBox);
    // ActionListener actionListener = new ActionListener() {
    // public void actionPerformed(ActionEvent actionEvent) {
    // AbstractButton abstractButton = (AbstractButton) actionEvent.getSource();
    // boolean selected = abstractButton.getModel().isSelected();
    // System.out.println(selected);
    // // abstractButton.setText(newLabel);
    // checkBox.addActionListener(new ActionListener(){
    //               public void actionPerformed(ActionEvent actionEvent) {
    //                    Checkbox cb = actionEvent.getSource();
    //     boolean selected = abstractButton.getModel().isSelected();
    //     System.out.println(selected);
    checkBox.setSize(checkBox.getPreferredSize());
    private static void trace(JCheckBox cb) {
         if (cb.isSelected())
              System.out.println(cb.getText()+" is " + cb.isSelected());
         else
              System.out.println(cb.getText()+" is " + cb.isSelected());
    protected void installMouseHandler() {
    if (handler == null) {
    handler = new MouseHandler();
    addMouseHandler(handler);
    protected void addMouseHandler(MouseHandler handler) {
    tree.addMouseListener(handler);
    tree.addMouseMotionListener(handler);
    private void updateMouseLocation(Point newLoc) {
    if (mouseRow != -1) {
    repaint(mouseRow);
    mouseLocation = newLoc;
    if (mouseLocation != null) {
    mouseRow = getRow(newLoc);
    repaint(mouseRow);
    else {
    mouseRow = -1;
    if (mouseRow != -1 && mouseLocation != null) {
    Point mouseLoc = new Point(mouseLocation);
    Rectangle r = getRowBounds(mouseRow);
    if (r != null)
    mouseLoc.x -= r.x;
    mouseInCheck = isInCheckBox(mouseLoc);
    else {
    mouseInCheck = false;
    protected int getRow(Point p) {
    return tree.getRowForLocation(p.x, p.y);
    protected Rectangle getRowBounds(int row) {
    return tree.getRowBounds(row);
    protected TreePath getPathForRow(int row) {
    return tree.getPathForRow(row);
    protected int getRowForPath(TreePath path) {
    return tree.getRowForPath(path);
    public void repaint(Rectangle r) {
    tree.repaint(r);
    public void repaint() {
    tree.repaint();
    private void repaint(int row) {
    Rectangle r = getRowBounds(row);
    if (r != null)
    repaint(r);
    public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
    installMouseHandler();
    TreePath path = getPathForRow(row);
    state = UNSELECTABLE;
    if (path != null) {
    if (isChecked(path)) {
    state = FULLSELECTED;
    else if (isPartiallyChecked(path)) {
    state = PARTIALSELECTED;
    else if (isSelectable(path)) {
    state = NOTSELECTED;
    checkBox.setSelected(state == FULLSELECTED);
    checkBox.getModel().setArmed(mouseRow == row && pressedRow == row && mouseInCheck);
    checkBox.getModel().setPressed(pressedRow == row && mouseInCheck);
    checkBox.getModel().setRollover(mouseRow == row && mouseInCheck);
    Component c = renderer.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
    checkBox.setForeground(c.getForeground());
    if (c instanceof JLabel) {
    JLabel label = (JLabel)c;
    // Augment the icon to include the checkbox
    Icon customOpenIcon = new ImageIcon("browse.gif");
    label.setIcon(new CompoundIcon(label.getIcon()));
    return c;
    private boolean isInCheckBox(Point where) {
    Insets insets = tree.getInsets();
    int right = checkBox.getWidth();
    int left = 0;
    if (insets != null) {
    left += insets.left;
    right += insets.left;
    return where.x >= left && where.x < right;
    public boolean isExplicitlyChecked(TreePath path) {
    return checkedPaths.contains(path);
    /** Returns whether selecting the given path is allowed. The default
    * returns true. You should return false if the given path represents
    * a placeholder for a node that has not yet loaded, or anything else
    * that doesn't represent a normal, operable object in the tree.
    public boolean isSelectable(TreePath path) {
    return true;
    /** Returns whether the given path is currently checked. */
    public boolean isChecked(TreePath path) {
    if (isExplicitlyChecked(path)) {
    return true;
    else {
    if (path.getParentPath() != null) {
    return isChecked(path.getParentPath());
    else {
    return false;
    public boolean isPartiallyChecked(TreePath path) {
    Object node = path.getLastPathComponent();
    for (int i = 0; i < tree.getModel().getChildCount(node); i++) {
    Object child = tree.getModel().getChild(node, i);
    TreePath childPath = path.pathByAddingChild(child);
    if (isChecked(childPath) || isPartiallyChecked(childPath)) {
    return true;
    return false;
    private boolean isFullyChecked(TreePath parent) {
    Object node = parent.getLastPathComponent();
    for (int i = 0; i < tree.getModel().getChildCount(node); i++) {
    Object child = tree.getModel().getChild(node, i);
    TreePath childPath = parent.pathByAddingChild(child);
    if (!isExplicitlyChecked(childPath)) {
    return false;
    return true;
    public void toggleChecked(int row) {
    TreePath path = getPathForRow(row);
    boolean isChecked = isChecked(path);
    removeDescendants(path);
    if (!isChecked) {
    checkedPaths.add(path);
    setParent(path);
    repaint();
    private void setParent(TreePath path) {
    TreePath parent = path.getParentPath();
    if (parent != null) {
    if (isFullyChecked(parent)) {
    removeChildren(parent);
    checkedPaths.add(parent);
    } else {
    if (isChecked(parent)) {
    checkedPaths.remove(parent);
    addChildren(parent);
    checkedPaths.remove(path);
    setParent(parent);
    private void addChildren(TreePath parent) {
    Object node = parent.getLastPathComponent();
    for (int i = 0; i < tree.getModel().getChildCount(node); i++) {
    Object child = tree.getModel().getChild(node, i);
    TreePath path = parent.pathByAddingChild(child);
    checkedPaths.add(path);
    private void removeChildren(TreePath parent) {
    for (Iterator i = checkedPaths.iterator(); i.hasNext();) {
    TreePath p = (TreePath) i.next();
    if (p.getParentPath() != null && parent.equals(p.getParentPath())) {
    i.remove();
    private void removeDescendants(TreePath ancestor) {
    for (Iterator i = checkedPaths.iterator(); i.hasNext();) {
    TreePath path = (TreePath) i.next();
    if (ancestor.isDescendant(path)) {
    i.remove();
    /** Returns all checked rows. */
    public int[] getCheckedRows() {
    TreePath[] paths = getCheckedPaths();
    int[] rows = new int[checkedPaths.size()];
    for (int i = 0; i < checkedPaths.size(); i++) {
    rows[i] = getRowForPath(paths);
    Arrays.sort(rows);
    return rows;
    /** Returns all checked paths. */
    public TreePath[] getCheckedPaths() {
    return (TreePath[]) checkedPaths.toArray(new TreePath[checkedPaths.size()]);
    protected class MouseHandler extends MouseAdapter implements MouseMotionListener {
    public void mouseEntered(MouseEvent e) {
    updateMouseLocation(e.getPoint());
    public void mouseExited(MouseEvent e) {
    updateMouseLocation(null);
    public void mouseMoved(MouseEvent e) {
    updateMouseLocation(e.getPoint());
    public void mouseDragged(MouseEvent e) {
    updateMouseLocation(e.getPoint());
    public void mousePressed(MouseEvent e) {
    pressedRow = e.getModifiersEx() == InputEvent.BUTTON1_DOWN_MASK
    ? getRow(e.getPoint()) : -1;
    updateMouseLocation(e.getPoint());
    public void mouseReleased(MouseEvent e) {
    if (pressedRow != -1) {
    int row = getRow(e.getPoint());
    if (row == pressedRow) {
    Point p = e.getPoint();
    Rectangle r = getRowBounds(row);
    p.x -= r.x;
    if (isInCheckBox(p)) {
    toggleChecked(row);
    pressedRow = -1;
    updateMouseLocation(e.getPoint());
    public void mouseClicked(MouseEvent e){
         if(checkBox.isSelected()){
              System.out.println(checkBox.getName());
    /** Combine a JCheckBox's checkbox with another icon. */
    private final class CompoundIcon implements Icon {
    private final Icon icon;
    private final int w;
    private final int h;
    private CompoundIcon(Icon icon) {
    if (icon == null) {
    icon = new Icon() {
    public int getIconHeight() { return 0; }
    public int getIconWidth() { return 0; }
    public void paintIcon(Component c, Graphics g, int x, int y) { }
    this.icon = icon;
    this.w = icon.getIconWidth();
    this.h = icon.getIconHeight();
    public int getIconWidth() {
    return checkBox.getPreferredSize().width + w;
    public int getIconHeight() {
    return Math.max(checkBox.getPreferredSize().height, h);
    public void paintIcon(Component c, Graphics g, int x, int y) {
    if (c.getComponentOrientation().isLeftToRight()) {
    int xoffset = checkBox.getPreferredSize().width;
    int yoffset = (getIconHeight()-icon.getIconHeight())/2;
    icon.paintIcon(c, g, x + xoffset, y + yoffset);
    if (state != UNSELECTABLE) {
    paintCheckBox(g, x, y);
    else {
    int yoffset = (getIconHeight()-icon.getIconHeight())/2;
    icon.paintIcon(c, g, x, y + yoffset);
    if (state != UNSELECTABLE) {
    paintCheckBox(g, x + icon.getIconWidth(), y);
    private void paintCheckBox(Graphics g, int x, int y) {
    int yoffset;
    boolean db = checkBox.isDoubleBuffered();
    checkBox.setDoubleBuffered(false);
    try {
    yoffset = (getIconHeight()-checkBox.getPreferredSize().height)/2;
    g = g.create(x, y+yoffset, getIconWidth(), getIconHeight());
    checkBox.paint(g);
    if (state == PARTIALSELECTED) {
    final int WIDTH = 2;
    g.setColor(UIManager.getColor("CheckBox.foreground"));
    Graphics2D g2d = (Graphics2D)g;
    g2d.setStroke(new BasicStroke(WIDTH, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
    g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    int w = checkBox.getWidth();
    int h = checkBox.getHeight();
    g.drawLine(w/4+2, h/2-WIDTH/2+1, w/4+w/2-3, h/2-WIDTH/2+1);
    g.dispose();
    finally {
    checkBox.setDoubleBuffered(db);
    private static String createText(TreePath[] paths) {
    if (paths.length == 0) {
    return "Nothing checked";
    String checked = "Checked:\n";
    for (int i=0;i < paths.length;i++) {
    checked += paths[i] + "\n";
    return checked;
    public static void main(String[] args) {
    try {
    final String SWITCH = "toggle-componentOrientation";
    try {
                   UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              } catch (ClassNotFoundException e1) {
                   e1.printStackTrace();
              } catch (InstantiationException e1) {
                   e1.printStackTrace();
              } catch (IllegalAccessException e1) {
                   e1.printStackTrace();
              } catch (UnsupportedLookAndFeelException e1) {
                   e1.printStackTrace();
    JFrame frame = new JFrame("Tree with Check Boxes");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    final DefaultMutableTreeNode a = new DefaultMutableTreeNode("Node 1");
    for(int i =0 ; i<3; i++ ){
         DefaultMutableTreeNode b = new DefaultMutableTreeNode("ChildNode "+i);
         a.add(b);
    DefaultMutableTreeNode e = new DefaultMutableTreeNode("Node 2");
    for(int i =0 ; i<3; i++ ){
         DefaultMutableTreeNode f = new DefaultMutableTreeNode("ChildNode "+i);
         e.add(f);
    DefaultMutableTreeNode al = new DefaultMutableTreeNode("Sample");
    al.add(a);
    al.add(e);
    final JTree tree = new JTree(al);
    final CheckBoxTreeCellRenderer r =
    new CheckBoxTreeCellRenderer(tree, tree.getCellRenderer());
    tree.setCellRenderer(r);
    int rc = tree.getRowCount();
    tree.getActionMap().put(SWITCH, new AbstractAction(SWITCH) {
    public void actionPerformed(ActionEvent e) {
    ComponentOrientation o = tree.getComponentOrientation();
    if (o.isLeftToRight()) {
    o = ComponentOrientation.RIGHT_TO_LEFT;
    else {
    o = ComponentOrientation.LEFT_TO_RIGHT;
    tree.setComponentOrientation(o);
    tree.repaint();
    int mask = InputEvent.SHIFT_MASK|Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
    tree.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_O, mask), SWITCH);
    final JTextArea text = new JTextArea(createText(r.getCheckedPaths()));
    text.setPreferredSize(new Dimension(200, 100));
    tree.addMouseListener(new MouseAdapter() {
    public void mouseReleased(MouseEvent e) {
    // Invoke later to ensure all mouse handling is completed
    SwingUtilities.invokeLater(new Runnable() { public void run() {
    text.setText(createText(r.getCheckedPaths()));
    JScrollPane pane = new JScrollPane(tree);
    frame.getContentPane().add(pane);
    // frame.getContentPane().add(new JScrollPane(text), BorderLayout.SOUTH);
    frame.pack();
    frame.setSize(600,400);
    frame.setVisible(true);
    catch(Exception e) {
    e.printStackTrace();
    System.exit(1);
    now i need to get nodes names which has been selected, how can i do this
    can anyone help me ...
    regards,
    shobi

    Also, use code tags and post a SSCCE -- I'm sure more of your posted code is irrelevant to your question and few people are going to look at a code listing that long.
    [http://mindprod.com/jgloss/sscce.html]

  • Using checkboxes with JOption Pane

    Hi, I having abit of trouble trying to implement a search utility into my swing based program. What I want is something also the lines of the "Find" feature available in MS Word and IE. Hence I want a message, input dialog box but also a checkbox to check does the user what to search for case sensitive material. So far I've been using JOptionPane and my code is as follows...
    String userInput = (String) JOptionPane.showInputDialog(null,"Enter Search Criteria:\n",     "Search Dialog",JOptionPane.QUESTION_MESSAGE,null,null,"");
    However it seems I cannot use checkboxes with this. Any idea how I could go about doing this using JOptionPane or if not would someone care to shed some light on how I might accomplish it?
    Thanks in advance,
    Simon

    JOptionPanes can be extended, but you would rather want to make a JDialog.
    Because you might also offer regular expression search (free in java 1.4),
    or search-and-replace.
    A google search will give examples like at the koders site.
    In general it pays to have all those little dialogs really user-friendly, say saving the last N sought terms + whether case-sensitive or not.
    Joop

  • HT204389 I just got an iPhone 4S model number MD439LL/A still have the box that it came in along with other info. I can not find Siri. I have looked in settings general and  settings general restrictions. Can anyone help me out?

    I just got an iPhone 4S model number MD439LL/A still have the box that it came in along with other info. I can not find Siri. I have looked in settings>general and  settings>general>restrictions. Can anyone help me out?

    That model is an iPhone 4, not a 4S.
    http://support.apple.com/kb/HT3939

  • Forms creation with fillable info

    I deal with the same set of forms everyday, but just with different info.  I have about 5 forms that I would like to "link together".  I have to repeat much of the same info over all 5 forms (shipper name, delivery location, freight description, weights, ID numbers, dates, etc...).  It would be great if I could enter the info once and have it drop that info in the correct spaces on each form rather than manually doing on each.  Is there any way to accomplish this easily?  I gather that I may need to create a "data base" page and have it pull the info across the document string or populate in to various drop down locations.  Thanks in advance!

    Are the form fields in all of these files named the same (at least, those
    that you want to populate with the same info)?

Maybe you are looking for