Writing text with NXT icon

Hi
Using LabView 2010 I tried to write text in certain x,y position and not in line. I could not find an equivalent Icon to do the job, Needed to use the NXT_DisplayText from the remote vi library (see attached picture)
The Vis from the remote library cannot be connected to the new NXT icon vi's  (Why?) and when i tried to link the sequence flow out from such a vi to the new vi i get an error message.
Questions:
how can I use the new NXT Icons to do the job?
was I right to select the remote library vi?
what should i do if i want to control the flow sequence usingboth types of vi's
attached is a description of a program I wrote in which i had this problem
Thanks
Moshe
Attachments:
Radar Project in Lab View.pdf ‏382 KB

Hi Tanya 
Thank you for your reply.
Although I posted this call for help, I have continued to search for the solution myself and finally I found that there is a vi to write to certain XY  location but that vi was not presented in the default NXT functions pallet ,nor was it clear to me that such vi exists. I have found it in the dual mode vi library C:\Program Files\National Instruments\LabVIEW 2010\vi.lib\NXT\Dual Mode Library and attached it also to the tools.
Now I did not need to use old remote vi s so it is OK now I attach the program I wrote and if you find this example usefull for showing others, you can use it.
Regards
Moshe Epshtain
Attachments:
Radar Project in Lab View.pdf ‏393 KB
Radar2.vi ‏30 KB

Similar Messages

  • I am having an issue writing texts with Siri on iPhone 5 iOS 6.  When I do it just talking to the phone it works fine. However if I speak through the ear pod headphones or Bluetooth headset it only writes about 5 works before trying to send.

    I am having an issue writing texts with Siri on iPhone 5 iOS 6.  When I do it just talking to the phone it works fine. However if I speak through the ear pod headphones or Bluetooth headset it only writes about 5 works before trying to send.
    Does anyone know why this might be?

        Hello APVzW, we absolutely want the best path to resolution. My apologies for multiple attempts of replacing the device. We'd like to verify the order information and see if we can locate the tracking number. Please send a direct message with the order number so we can dive deeper. Here's steps to send a direct message: http://vz.to/1b8XnPy We look forward to hearing from you soon.
    WiltonA_VZW
    VZW Support
    Follow us on twitter @VZWSupport

  • How do I create self-writing text with overlaps?

    I've tried having a look around online and searching on here without much luck.
    I'm new to after effects and I've managed to create a basic self-writing text effect from videos online using a path and stroke technique, but there is a problem with using this technique for what I want. The text I am using has overlaps, where there are intersections, meaning that when I stroke through this area it shows chucks at the side of that line of text from the intersecting line (see below)
    I think the solution is to use a variable width stroke, where I can set the width correctly for each part of the path, but I don't seem to be able to find how to do this on CS6. I only seem to be able to define a width for the entire path at the same time

    Take a close look at this project. It's part of an upcoming tutorial on animating text and masks. Maybe the project will help. It's saved as a CC.
    Note: Dropbox will probably add a .txt extension to the file so just remove it so it just says ScriptWriteOnText_CC.aep and it should open just fine.
    The procedure was to create a text layer, then convert the text to a shape, then add a solid with stroke below the shape. I then animated the end of the Stroke with stroke set to On Transparent. I used the shape layer as a track matte to trim the stroke to the exact shape of the text converted to shape layer. I then added and animated the masks on the track matte layer. Each mask was changed to subtract and as I scrubbed through the timeline I added as many masks as I needed to clean up the crossing lines.
    There are many ways to do this. You could split the layer at the cross over, work the other way around, use Paint, but the idea is always the same and it's tedious, especially if there are a lot of crossing points. You could even create your text layers in Illustrator, convert the text to outlines, then divide up the segments of the letters and sequence them in After Effects.
    The faster you make the animation the easier it is to hide the crossing problems. For example, it only takes me about 3 seconds to sign my full name and with a signature that is that fast you could get away with a lot.

  • Writing Text with different orientation degrees

    Hello All,
    I just wanna know about writing the text vertically.
    I don't mean this:
    T
    E
    X
    T
    I mean as we write in MS word or other applications with orientation of 90 degrees.
    Thanx in advance.

    import java.awt.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class TipsyText extends JPanel {
        String text = "hello world";
        Point p = new Point(200,250);
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
                                RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
            g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
                                RenderingHints.VALUE_STROKE_PURE);
            g2.setPaint(Color.red);
            g2.fill(new Ellipse2D.Double(p.x-2, p.y-2, 4, 4));
            AffineTransform at = AffineTransform.getTranslateInstance(p.x,p.y);
            at.rotate(-Math.PI/2);
            g2.setFont(g2.getFont().deriveFont(28f).deriveFont(at));
            g2.setPaint(Color.black);
            g2.drawString(text, 0, 0);
        public static void main(String[] args) {
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.add(new TipsyText());
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    }

  • Text based VI Icon editor with letter compression

    For anyone who is looking for a quick and easy text based icon editor I've posted my latest version in the LAVA CR
     http://forums.lavag.org/downloads.html&showfile=56
    Description:
    This is the second version of my vi icon editor and was created in LV8.2. The purpose is to help quickly create text base icons. The editor can be used in place of the standard NI icon editor or as a stand alone vi. see instructions. My original posting of the icon editor Ver. 1 can be found here
    LabVIEW 7.0,7.1 http://forums.lavag.org/index.php?s=&s...ost&p=19022
    LabVIEW 8.0 http://forums.lavag.org/index.php?s=&s...ost&p=12920
    Instructions:
    1: The icon editor was designed to be used as a replacement for the standard NI editor LV8.x only. To get LabVIEW 8.x to use the editor place the three files (lv_icon.vi, color templates.bin and the folder lv_icon_Subvis) in the LabVIEW 8.2\resource\plugins directory.
    The next time the icon editor is called LabVIEW will use the lv_icon.vi instead of the standard one.
    There is a button on the editor that will allow you to use NI’s editor when a text icon is not desired.
    2: The icon editor can also be called from another vi or used as a stand alone tool. Make sure the “From Editor” control is set to false either via terminal in the lower left corner of the connector pane or manually in the FP. This setting indicates to the vi that a vi reference will be used to extract and save the icon information. If the “VI REF” input control is invalid at runtime a dialogue box will appear asking the user to select a vi.
    New features:
    Along with the auto drawing and Text compressing from version 1, version 2 has 2 new features.
    1: In addition to the 2 color format in version 1 the icon editor now supports a 5 color format (Frame, Header text, Header Back, Body Text, and Body Back). This is the standard frame that many programmers use.
    2: In version 2 the last 10 icon color sets are saved in a binary file and are recalled each time the editor is open. These color sets can then be selected and reused.
    Future Ideas and improvements:
    A graphics picker that would import a list of graphics to choose from
    Template creators were text zones could be created to avoid interfering with graphics.
    Incorporate some or all of the Ni editor functions.
    Text extractor that would fill in the text boxes from the icon image.
    Please feel free to give me feedback. This version has benefited greatly from ideas given to me by coworkers and other programmers.
    License:
    Creative Commons Attribution 2.5 License

    For anyone who is looking for a quick and easy text based vi icon editor I've posted my latest version in the LAVA CR
    http://forums.lavag.org/index.php?automodule=downloads&showfile=56
    File: Mark Balla Icon editor V2.2
    Author: Mark Balla
    [email protected]
    Description:
    This is the newest version of my vi icon editor and was created in LV8.2. The purpose is to help quickly create text base icons. The editor can be used in place of the standard NI icon editor or as a stand alone vi. see instructions. My original posting of the icon editor Ver. 1 can be found here
    LabVIEW 7.0,7.1 http://forums.lavag.org/index.php?s=&s...ost&p=19022
    LabVIEW 8.0 http://forums.lavag.org/index.php?s=&s...ost&p=12920
    Instructions:
    1: The icon editor was designed to be used as a replacement for the standard NI editor LV8.x only. To get LabVIEW 8.x to use the editor place the three files (lv_icon.vi, color templates.bin and the folder lv_icon_Subvis) in the LabVIEW 8.2\resource\plugins directory.
    The next time the icon editor is called LabVIEW will use the lv_icon.vi instead of the standard one.
    There is a button on the editor that will allow you to use NI's editor when a text icon is not desired.
    2: The icon editor can also be called from another vi or used as a stand alone tool. Make sure the "From Editor" control is set to false either via terminal in the lower left corner of the connector pane or manually in the FP. This setting indicates to the vi that a vi reference will be used to extract and save the icon information. If the "VI REF" input control is invalid at runtime a dialogue box will appear asking the user to select a vi.
    Version 2.1:
    Along with the auto drawing and Text compressing from version 1, version 2 has 2 new features.
    1: In addition to the 2 color format in version 1 the icon editor now supports a 5 color format (Frame, Header text, Header Back, Body Text, and Body Back). This is the standard frame that many programmers use.
    2: In version 2 the last 10 icon color sets are saved in a binary file and are recalled each time the editor is open. These color sets can then be selected and reused.
    Version 2.2:
    Along with the all the features from version 2.1, version 2.2 has several new features.
    1: A new color picker was added. The standard NI color picker has been replaced by one that will only show the legal 221 colors allowed by LabVIEW for icons.
    My thanks to Justin Goeres for the idea.
    2:Key navigation has improved. The key navigation will only set focus to the text boxes to navigate between boxes use the tab, enter, up and down keys.
    My thanks to boone_93 for the idea.
    3:Improved UI. The buttons and current and previous icons have been relocated for a more intuitive look. I have also added tip strips to the buttons and history array.
    My thanks to ahull for the idea.
    4:Random color picker. A random color button has been added to help pick colors.
    My thanks to Dave Graybeal for the idea.
    5: FP auto centers. The icon editor will now open in the center of the primary display.
    My thanks to tcplomp for the code.
    6: The ability to read the text in the icon was added. If the icon to be changed was previously created by this icon editor the program will automatically detect the characters in the icon and convert them back into strings. This function allows for small changes like color changes and spelling mistakes to be changed without having to type all the text over.
    This one was all mine.
    7:Bug with Panel close fixed. When the user presses the x in the upper right corner the editor will shut down gracefully instead of locking up.
    I made a avi file that shows some of the new features for Version 2.2 which I posted the support thread.
    Please feel free to give me feedback. This version has benefited greatly from ideas given to me by coworkers and other programmers.
    License:
    Creative Commons Attribution 2.5 License
    Attachments:
    picture of editor.png ‏47 KB

  • BasicArrowButton with text and/or icon

    Hi, I have to display a button that has the arrow from BasicArrowButton but also display text and/or icon. I made a JPanel that has a JButton and a BasicArrowButton and everything looks fine except that the border I see covers only the JButton... I know I can just call setBorder to the panel but it has to be the same border from a regular JButton and be look and feel compatible. I tried this line:
    panel.setBorder(button.getBorder());
    But I get a ClassCastException. The only thing I can think of is to override the paint method from the JButton, but I don't really know how to do this...
    Thanks for the help

    From your previous thread you are aware that JMenu and JMenuItem both extend AbstractButton. So, you should be able to play with the borders and margins:
    setBorder(null);
    setMargin( new Insets(0, 0, 0, 0) );

  • Mail icons, can i have text with icons

    My missus is a computer novice but i am pleased with her progress with her iPad2, but she does struggle when using Mail, she finds the icons very vague in what they represent, i was hoping there might be an option to have text under  the icon, or perhaps text on it's own ?
    tim

    No, there is no option to have just text or icons with text in the Mail app (http://www.apple.com/feedback/ipad.html). As a work-around you can always do a screenshot, print it off, and label the icons so that she's got something handy to refer to

  • Button with text UNDER the icon

    Ho,
    I want to create a square button, where the text is UNDER the icon.
    Is there an easy way to do this, or do I need to write my own component?
    Cheers
    Jens

    Hi,
    Use ID in your button. Suppose i have used buttonId then my CSS will look like this.
    <style type="text/css">
    #buttonId-img.sapUiIcon {
    text-align: center;
    display: block;
    vertical-align: top;
    line-height: 100%;
    #buttonId.sapMBtn  {
    height: 5.0rem;
    min-width: 5.0rem;
    margin: 0;
    padding: 0;
    vertical-align: top;
    background-color: #f7f7f7;
    border: 1px solid #bfbfbf;
    color: #333333;
    text-shadow: 0 1px 0 #ffffff;
    font-family: Arial,Helvetica,sans-serif;
    font-size: 0.875rem;
    .sapMBtnContent>.sapUiIcon {
    color: #666666;
    font-size: 1.375rem;
    line-height: 2.875rem;
    width: 2.875rem;
    text-align: center;
    margin: auto;
    </style>
    This is screenshot.
    Id of first button id buttonId and for second is button1Id.
    This is view code now.
           createContent : function(oController) {
                  jQuery.sap.require("sap.ui.core.IconPool");
                  var oButton = new sap.m.Button("buttonId",{
                         text: "Press Me",
                         icon: sap.ui.core.IconPool.getIconURI("customer"),
                  var oButton1 = new sap.m.Button("button1Id",{
                         text: "Press Me",
                         icon: sap.ui.core.IconPool.getIconURI("customer"),
                  return new sap.m.Page({
                         title: "Title",
                         content: [
                                   oButton, oButton1
    Go through 3rd method of this document for doing experiments with your CSS. Implementing CSS in SAPUI5 Application
    Regards
    Dhananjay

  • Display a text  with icon in a JTable cell and a textarea on click of icon

    Hello,
    I need to modify the JTable, so that in some cells I can display a text with a small icon or symbol, on click of the the icon or symbol a small JTextArea or a display should open exactly at the position of mouse click to display list of text values.
    I searched this forum, but could not find the right solution... a code example will be good....
    Eagerly waiting....
    Serj

    Are you using an annonymous inner class for your mouse listener? I think this coudl cause some problems in your case.
    Try creating your own listener class e.g.
    class myListener extends MouseListener(){....}
    in this class, add a field such as 'name' - set with the constructor. So when you create your "outer table" write something like..
    outerTable.addMouseListener(new myListener("outer"));
    And when you create the inner table, write something like
    innerTable.addMouseListener(new myListener("inner"));
    Then when you capture Mouse click events, you can work out whether the click came from an outer table or inner table:
    public void mouseClicked(MouseEvent e){
    if(this.name.equals("inner")).....
    else.....
    In this way you should avoid the problem of knowing which table was clicked on...and still us the same mouse listener.
    I hope this is what you mean!
    Chris.

  • Problem with Arabic font: In certain contexts, when writing Arabic with vowel signs (fatha, damma, kasra, sukun) a sequence of sukun   fatha/damma etc. would reverse automatically. Is this a known bug?

    Problem with Arabic font: In certain contexts, when writing Arabic with vowel signs (fatha, damma, kasra, sukun) a sequence of sukun + fatha/damma etc. would reverse automatically. Is this a known bug?
    Example: عَيْنٌ
    would automatically convert to عَيُنْ
    Funnily, it doesn't seem to happen here, but it does when entering text in a web interface (using Firefox, font Bayan) and when using Text Edit.
    Seems to be a problem of a specific font, as e.g. Arial MS Unicode works fine. Any hints?
    Thank you!

    Musaafir wrote:
    I've no idea how i can even start using arabic vowels on Microsoft Word for Apple
    You can't do Arabic on MS Word for Mac.  This app has never supported RTL scripts, so you need to use something else.  Mellel is best, but Pages 5, TextEdit, Nisus Writer, Open/LibreOffice should work OK.
    You switch between languages by using the "flag" menu at the top right of the screen or by using the keyboard shortcuts apple/command plus space.  Go to system prefs/keyboard/shortcuts to make sure that is activated.
    To see which key does what, you use Keyboard  Viewer.
    http://support.apple.com/kb/PH13746
    You place vowels on letters by typing the key for the vowel after the key for the letter.  The vowels are on the option/alt keys, option/alt + a gives you َ

  • Adobe Acrobat X Pro writing text not smooth.

    I use tablet pc for education in university and I try Adobe Acrobat X Pro writing text it not smooth text can you have add-in pen input support or support pen writing (smooth)for tablet pc?

    If you want to annotate the PDF directly on a tablet, use PDF Annotator. The annotation capabilities of Acrobat are poor. You also have to select the erase tool to erase, rather than just turn the pen over. PDF Annotator works the way you would expect annotation to work with a pen. It is also useful if you grade PDFs on the tablet. The only thing I find annoying with Annotator is that the paging is a bit clunky. You should be able to find an educational price for the package, or possibly your school has it under license. There is a 30-day trial if you would like to try it. Most folks here would not dream of annotating with Acrobat for the same reasons you have found.

  • How to display a button with an icon?

    Hi,
    I'd like to display an SAP-icon on a button.
    In this thread How can I show an Icon in the tapStripItem-title?
    Thomas Jung gave the following example:
    > I don't know if this definetely works with tabstrips
    > items but it does work with buttons and toolbar
    > buttons.  What I do is create a BEE and render that
    > to a string. I then use that string as the text of
    > the element I want to place my image into:
    >
    >   <%
    >   data image type ref to cl_htmlb_image.
    >   data: image_string type string.
    >   create object image.
    >   image->id = `UserSelectionCancel2`.
    >   image->src = cl_bsp_mimes=>sap_icon( `ICON_CHECKED` D`).
    >   image->tooltip = ``.
    >   clear image_string.
    >   image_string = image->IF_BSP_BEE~RENDER_TO_STRING( G( page_context ).
    >   %>
    > <xhtmlb:toolbarButton id            = "UserSelectionCancel"
    > onClientClick = "closeiframe();"
    > enabled       = "<%= enabled %>"
    > text          = "<%= image_string %>" />
    I didn't find anything else about this topic and
    tried to adopt this for a button, but that doesn't work for me either.
    <htmlb:button id            = "byButt"
       text    = "<%= image_string %> ENTER"
       onClick = "myClickHandler"  />
    Is there a way/documentation to get this done?
    Thanks in advance.
    Cheers.
    -Alf

    > This technique is really just using a BEE, there is
    > documentation on the BEE concept in the online help
    > and Brian McKellar has a weblog on the subject as
    > well.
    OK, I think I get the idea. Will check the stuff. Thanks.
    > Notice the strange D at the end of the line. This
    > isn't in the original posting. Perhaps this is just
    > bad cut and paste.
    Just bad copy paste. Yes.
    > You say that this isn't working for you - but you
    > don't describe the results. Is there an error?  Does
    > it render anything in the button at all?  Does the
    > raw HTML get rendered?
    I just saw coding in the button.
    > You want to make sure that the
    > text doesn't get encoded - which would cause the HTML
    > source to display instead. On the htmlb:button you
    > will want to set the attribute encode = FALSE.
    OK, that was right on spot. This shows me the Icon! Strike!
    > Also I am not sure that you can also pass in text
    > with the image like that.  You might have to create a
    > full BEE and add the image and a textView separately
    > into the BEE.  Then render the entire BEE to a string.
    I'll check the documentation on BEE and give it a try.
    Thanks for your answer.
    Thats a starting point for me.
    Alf

  • JTabbedPane with close Icons

    Ok, so I was trying to get a JTabbedPane with 'X' icons on each tab. Searched this site, and found no answers, but loads of questions on how to do it. I've done it now, and here's my code.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    * A JTabbedPane which has a close ('X') icon on each tab.
    * To add a tab, use the method addTab(String, Component)
    * To have an extra icon on each tab (e.g. like in JBuilder, showing the file type) use
    * the method addTab(String, Component, Icon). Only clicking the 'X' closes the tab.
    public class JTabbedPaneWithCloseIcons extends JTabbedPane implements MouseListener {
      public JTabbedPaneWithCloseIcons() {
        super();
        addMouseListener(this);
      public void addTab(String title, Component component) {
        this.addTab(title, component, null);
      public void addTab(String title, Component component, Icon extraIcon) {
        super.addTab(title, new CloseTabIcon(extraIcon), component);
      public void mouseClicked(MouseEvent e) {
        int tabNumber=getUI().tabForCoordinate(this, e.getX(), e.getY());
        if (tabNumber < 0) return;
        Rectangle rect=((CloseTabIcon)getIconAt(tabNumber)).getBounds();
        if (rect.contains(e.getX(), e.getY())) {
          //the tab is being closed
          this.removeTabAt(tabNumber);
      public void mouseEntered(MouseEvent e) {}
      public void mouseExited(MouseEvent e) {}
      public void mousePressed(MouseEvent e) {}
      public void mouseReleased(MouseEvent e) {}
    * The class which generates the 'X' icon for the tabs. The constructor
    * accepts an icon which is extra to the 'X' icon, so you can have tabs
    * like in JBuilder. This value is null if no extra icon is required.
    class CloseTabIcon implements Icon {
      private int x_pos;
      private int y_pos;
      private int width;
      private int height;
      private Icon fileIcon;
      public CloseTabIcon(Icon fileIcon) {
        this.fileIcon=fileIcon;
        width=16;
        height=16;
      public void paintIcon(Component c, Graphics g, int x, int y) {
        this.x_pos=x;
        this.y_pos=y;
        Color col=g.getColor();
        g.setColor(Color.black);
        int y_p=y+2;
        g.drawLine(x+1, y_p, x+12, y_p);
        g.drawLine(x+1, y_p+13, x+12, y_p+13);
        g.drawLine(x, y_p+1, x, y_p+12);
        g.drawLine(x+13, y_p+1, x+13, y_p+12);
        g.drawLine(x+3, y_p+3, x+10, y_p+10);
        g.drawLine(x+3, y_p+4, x+9, y_p+10);
        g.drawLine(x+4, y_p+3, x+10, y_p+9);
        g.drawLine(x+10, y_p+3, x+3, y_p+10);
        g.drawLine(x+10, y_p+4, x+4, y_p+10);
        g.drawLine(x+9, y_p+3, x+3, y_p+9);
        g.setColor(col);
        if (fileIcon != null) {
          fileIcon.paintIcon(c, g, x+width, y_p);
      public int getIconWidth() {
        return width + (fileIcon != null? fileIcon.getIconWidth() : 0);
      public int getIconHeight() {
        return height;
      public Rectangle getBounds() {
        return new Rectangle(x_pos, y_pos, width, height);
    }You can also specify an extra icon to put on each tab. Read my comments on how to do it.

    With the following code you'll be able to have use SCROLL_TAB_LAYOUT and WRAP_TAB_LAYOUT. With setCloseIcons() you'll be able to set images for the close-icons.
    The TabbedPane:
    import javax.swing.Icon;
    import javax.swing.JComponent;
    import javax.swing.JTabbedPane;
    import javax.swing.JViewport;
    import javax.swing.SwingUtilities;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.FontMetrics;
    import java.awt.Graphics;
    import java.awt.Point;
    import java.awt.Rectangle;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.awt.event.MouseMotionListener;
    import javax.swing.event.EventListenerList;
    import javax.swing.plaf.basic.BasicTabbedPaneUI;
    import javax.swing.plaf.metal.MetalTabbedPaneUI;
    * A JTabbedPane which has a close ('X') icon on each tab.
    * To add a tab, use the method addTab(String, Component)
    * To have an extra icon on each tab (e.g. like in JBuilder, showing the file
    * type) use the method addTab(String, Component, Icon). Only clicking the 'X'
    * closes the tab.
    public class CloseableTabbedPane extends JTabbedPane implements MouseListener,
      MouseMotionListener {
       * The <code>EventListenerList</code>.
      private EventListenerList listenerList = null;
       * The viewport of the scrolled tabs.
      private JViewport headerViewport = null;
       * The normal closeicon.
      private Icon normalCloseIcon = null;
       * The closeicon when the mouse is over.
      private Icon hooverCloseIcon = null;
       * The closeicon when the mouse is pressed.
      private Icon pressedCloseIcon = null;
       * Creates a new instance of <code>CloseableTabbedPane</code>
      public CloseableTabbedPane() {
        super();
        init(SwingUtilities.LEFT);
       * Creates a new instance of <code>CloseableTabbedPane</code>
       * @param horizontalTextPosition the horizontal position of the text (e.g.
       * SwingUtilities.TRAILING or SwingUtilities.LEFT)
      public CloseableTabbedPane(int horizontalTextPosition) {
        super();
        init(horizontalTextPosition);
       * Initializes the <code>CloseableTabbedPane</code>
       * @param horizontalTextPosition the horizontal position of the text (e.g.
       * SwingUtilities.TRAILING or SwingUtilities.LEFT)
      private void init(int horizontalTextPosition) {
        listenerList = new EventListenerList();
        addMouseListener(this);
        addMouseMotionListener(this);
        if (getUI() instanceof MetalTabbedPaneUI)
          setUI(new CloseableMetalTabbedPaneUI(horizontalTextPosition));
        else
          setUI(new CloseableTabbedPaneUI(horizontalTextPosition));
       * Allows setting own closeicons.
       * @param normal the normal closeicon
       * @param hoover the closeicon when the mouse is over
       * @param pressed the closeicon when the mouse is pressed
      public void setCloseIcons(Icon normal, Icon hoover, Icon pressed) {
        normalCloseIcon = normal;
        hooverCloseIcon = hoover;
        pressedCloseIcon = pressed;
       * Adds a <code>Component</code> represented by a title and no icon.
       * @param title the title to be displayed in this tab
       * @param component the component to be displayed when this tab is clicked
      public void addTab(String title, Component component) {
        addTab(title, component, null);
       * Adds a <code>Component</code> represented by a title and an icon.
       * @param title the title to be displayed in this tab
       * @param component the component to be displayed when this tab is clicked
       * @param extraIcon the icon to be displayed in this tab
      public void addTab(String title, Component component, Icon extraIcon) {
        boolean doPaintCloseIcon = true;
        try {
          Object prop = null;
          if ((prop = ((JComponent) component).
                        getClientProperty("isClosable")) != null) {
            doPaintCloseIcon = (Boolean) prop;
        } catch (Exception ignored) {/*Could probably be a ClassCastException*/}
        super.addTab(title,
                     doPaintCloseIcon ? new CloseTabIcon(extraIcon) : null,
                     component);
        if (headerViewport == null) {
          for (Component c : getComponents()) {
            if ("TabbedPane.scrollableViewport".equals(c.getName()))
              headerViewport = (JViewport) c;
       * Invoked when the mouse button has been clicked (pressed and released) on
       * a component.
       * @param e the <code>MouseEvent</code>
      public void mouseClicked(MouseEvent e) {
        processMouseEvents(e);
       * Invoked when the mouse enters a component.
       * @param e the <code>MouseEvent</code>
      public void mouseEntered(MouseEvent e) { }
       * Invoked when the mouse exits a component.
       * @param e the <code>MouseEvent</code>
      public void mouseExited(MouseEvent e) {
        for (int i=0; i<getTabCount(); i++) {
          CloseTabIcon icon = (CloseTabIcon) getIconAt(i);
          if (icon != null)
            icon.mouseover = false;
        repaint();
       * Invoked when a mouse button has been pressed on a component.
       * @param e the <code>MouseEvent</code>
      public void mousePressed(MouseEvent e) {
        processMouseEvents(e);
       * Invoked when a mouse button has been released on a component.
       * @param e the <code>MouseEvent</code>
      public void mouseReleased(MouseEvent e) { }
       * Invoked when a mouse button is pressed on a component and then dragged.
       * <code>MOUSE_DRAGGED</code> events will continue to be delivered to the
       * component where the drag originated until the mouse button is released
       * (regardless of whether the mouse position is within the bounds of the
       * component).<br/>
       * <br/>
       * Due to platform-dependent Drag&Drop implementations,
       * <code>MOUSE_DRAGGED</code> events may not be delivered during a native
       * Drag&Drop operation.
       * @param e the <code>MouseEvent</code>
      public void mouseDragged(MouseEvent e) {
        processMouseEvents(e);
       * Invoked when the mouse cursor has been moved onto a component but no
       * buttons have been pushed.
       * @param e the <code>MouseEvent</code>
      public void mouseMoved(MouseEvent e) {
        processMouseEvents(e);
       * Processes all caught <code>MouseEvent</code>s.
       * @param e the <code>MouseEvent</code>
      private void processMouseEvents(MouseEvent e) {
        int tabNumber = getUI().tabForCoordinate(this, e.getX(), e.getY());
        if (tabNumber < 0) return;
        CloseTabIcon icon = (CloseTabIcon) getIconAt(tabNumber);
        if (icon != null) {
          Rectangle rect= icon.getBounds();
          Point pos = headerViewport == null ?
                      new Point() : headerViewport.getViewPosition();
          Rectangle drawRect = new Rectangle(
            rect.x - pos.x, rect.y - pos.y, rect.width, rect.height);
          if (e.getID() == e.MOUSE_PRESSED) {
            icon.mousepressed = e.getModifiers() == e.BUTTON1_MASK;
            repaint(drawRect);
          } else if (e.getID() == e.MOUSE_MOVED || e.getID() == e.MOUSE_DRAGGED ||
                     e.getID() == e.MOUSE_CLICKED) {
            pos.x += e.getX();
            pos.y += e.getY();
            if (rect.contains(pos)) {
              if (e.getID() == e.MOUSE_CLICKED) {
                int selIndex = getSelectedIndex();
                if (fireCloseTab(selIndex)) {
                  if (selIndex > 0) {
                    // to prevent uncatchable null-pointers
                    Rectangle rec = getUI().getTabBounds(this, selIndex - 1);
                    MouseEvent event = new MouseEvent((Component) e.getSource(),
                                                      e.getID() + 1,
                                                      System.currentTimeMillis(),
                                                      e.getModifiers(),
                                                      rec.x,
                                                      rec.y,
                                                      e.getClickCount(),
                                                      e.isPopupTrigger(),
                                                      e.getButton());
                    dispatchEvent(event);
                  //the tab is being closed
                  //removeTabAt(tabNumber);
                  remove(selIndex);
                } else {
                  icon.mouseover = false;
                  icon.mousepressed = false;
                  repaint(drawRect);
              } else {
                icon.mouseover = true;
                icon.mousepressed = e.getModifiers() == e.BUTTON1_MASK;
            } else {
              icon.mouseover = false;
            repaint(drawRect);
       * Adds an <code>CloseableTabbedPaneListener</code> to the tabbedpane.
       * @param l the <code>CloseableTabbedPaneListener</code> to be added
      public void addCloseableTabbedPaneListener(CloseableTabbedPaneListener l) {
        listenerList.add(CloseableTabbedPaneListener.class, l);
       * Removes an <code>CloseableTabbedPaneListener</code> from the tabbedpane.
       * @param l the listener to be removed
      public void removeCloseableTabbedPaneListener(CloseableTabbedPaneListener l) {
        listenerList.remove(CloseableTabbedPaneListener.class, l);
       * Returns an array of all the <code>SearchListener</code>s added to this
       * <code>SearchPane</code> with addSearchListener().
       * @return all of the <code>SearchListener</code>s added or an empty array if
       * no listeners have been added
      public CloseableTabbedPaneListener[] getCloseableTabbedPaneListener() {
        return listenerList.getListeners(CloseableTabbedPaneListener.class);
       * Notifies all listeners that have registered interest for notification on
       * this event type.
       * @param tabIndexToClose the index of the tab which should be closed
       * @return true if the tab can be closed, false otherwise
      protected boolean fireCloseTab(int tabIndexToClose) {
        boolean closeit = true;
        // Guaranteed to return a non-null array
        Object[] listeners = listenerList.getListenerList();
        for (Object i : listeners) {
          if (i instanceof CloseableTabbedPaneListener) {
            if (!((CloseableTabbedPaneListener) i).closeTab(tabIndexToClose)) {
              closeit = false;
              break;
        return closeit;
       * The class which generates the 'X' icon for the tabs. The constructor
       * accepts an icon which is extra to the 'X' icon, so you can have tabs
       * like in JBuilder. This value is null if no extra icon is required.
      class CloseTabIcon implements Icon {
         * the x position of the icon
        private int x_pos;
         * the y position of the icon
        private int y_pos;
         * the width the icon
        private int width;
         * the height the icon
        private int height;
         * the additional fileicon
        private Icon fileIcon;
         * true whether the mouse is over this icon, false otherwise
        private boolean mouseover = false;
         * true whether the mouse is pressed on this icon, false otherwise
        private boolean mousepressed = false;
         * Creates a new instance of <code>CloseTabIcon</code>
         * @param fileIcon the additional fileicon, if there is one set
        public CloseTabIcon(Icon fileIcon) {
          this.fileIcon = fileIcon;
          width  = 16;
          height = 16;
         * Draw the icon at the specified location. Icon implementations may use the
         * Component argument to get properties useful for painting, e.g. the
         * foreground or background color.
         * @param c the component which the icon belongs to
         * @param g the graphic object to draw on
         * @param x the upper left point of the icon in the x direction
         * @param y the upper left point of the icon in the y direction
        public void paintIcon(Component c, Graphics g, int x, int y) {
          boolean doPaintCloseIcon = true;
          try {
            // JComponent.putClientProperty("isClosable", new Boolean(false));
            JTabbedPane tabbedpane = (JTabbedPane) c;
            int tabNumber = tabbedpane.getUI().tabForCoordinate(tabbedpane, x, y);
            JComponent curPanel = (JComponent) tabbedpane.getComponentAt(tabNumber);
            Object prop = null;
            if ((prop = curPanel.getClientProperty("isClosable")) != null) {
              doPaintCloseIcon = (Boolean) prop;
          } catch (Exception ignored) {/*Could probably be a ClassCastException*/}
          if (doPaintCloseIcon) {
            x_pos = x;
            y_pos = y;
            int y_p = y + 1;
            if (normalCloseIcon != null && !mouseover) {
              normalCloseIcon.paintIcon(c, g, x, y_p);
            } else if (hooverCloseIcon != null && mouseover && !mousepressed) {
              hooverCloseIcon.paintIcon(c, g, x, y_p);
            } else if (pressedCloseIcon != null && mousepressed) {
              pressedCloseIcon.paintIcon(c, g, x, y_p);
            } else {
              y_p++;
              Color col = g.getColor();
              if (mousepressed && mouseover) {
                g.setColor(Color.WHITE);
                g.fillRect(x+1, y_p, 12, 13);
              g.setColor(Color.black);
              g.drawLine(x+1, y_p, x+12, y_p);
              g.drawLine(x+1, y_p+13, x+12, y_p+13);
              g.drawLine(x, y_p+1, x, y_p+12);
              g.drawLine(x+13, y_p+1, x+13, y_p+12);
              g.drawLine(x+3, y_p+3, x+10, y_p+10);
              if (mouseover)
                g.setColor(Color.GRAY);
              g.drawLine(x+3, y_p+4, x+9, y_p+10);
              g.drawLine(x+4, y_p+3, x+10, y_p+9);
              g.drawLine(x+10, y_p+3, x+3, y_p+10);
              g.drawLine(x+10, y_p+4, x+4, y_p+10);
              g.drawLine(x+9, y_p+3, x+3, y_p+9);
              g.setColor(col);
              if (fileIcon != null) {
                fileIcon.paintIcon(c, g, x+width, y_p);
         * Returns the icon's width.
         * @return an int specifying the fixed width of the icon.
        public int getIconWidth() {
          return width + (fileIcon != null ? fileIcon.getIconWidth() : 0);
         * Returns the icon's height.
         * @return an int specifying the fixed height of the icon.
        public int getIconHeight() {
          return height;
         * Gets the bounds of this icon in the form of a <code>Rectangle<code>
         * object. The bounds specify this icon's width, height, and location
         * relative to its parent.
         * @return a rectangle indicating this icon's bounds
        public Rectangle getBounds() {
          return new Rectangle(x_pos, y_pos, width, height);
       * A specific <code>BasicTabbedPaneUI</code>.
      class CloseableTabbedPaneUI extends BasicTabbedPaneUI {
        * the horizontal position of the text
        private int horizontalTextPosition = SwingUtilities.LEFT;
         * Creates a new instance of <code>CloseableTabbedPaneUI</code>
        public CloseableTabbedPaneUI() {
         * Creates a new instance of <code>CloseableTabbedPaneUI</code>
         * @param horizontalTextPosition the horizontal position of the text (e.g.
         * SwingUtilities.TRAILING or SwingUtilities.LEFT)
        public CloseableTabbedPaneUI(int horizontalTextPosition) {
          this.horizontalTextPosition = horizontalTextPosition;
         * Layouts the label
         * @param tabPlacement the placement of the tabs
         * @param metrics the font metrics
         * @param tabIndex the index of the tab
         * @param title the title of the tab
         * @param icon the icon of the tab
         * @param tabRect the tab boundaries
         * @param iconRect the icon boundaries
         * @param textRect the text boundaries
         * @param isSelected true whether the tab is selected, false otherwise
        protected void layoutLabel(int tabPlacement, FontMetrics metrics,
                                   int tabIndex, String title, Icon icon,
                                   Rectangle tabRect, Rectangle iconRect,
                                   Rectangle textRect, boolean isSelected) {
          textRect.x = textRect.y = iconRect.x = iconRect.y = 0;
          javax.swing.text.View v = getTextViewForTab(tabIndex);
          if (v != null) {
            tabPane.putClientProperty("html", v);
          SwingUtilities.layoutCompoundLabel((JComponent) tabPane,
                                             metrics, title, icon,
                                             SwingUtilities.CENTER,
                                             SwingUtilities.CENTER,
                                             SwingUtilities.CENTER,
                                             //SwingUtilities.TRAILING,
                                             horizontalTextPosition,
                                             tabRect,
                                             iconRect,
                                             textRect,
                                             textIconGap + 2);
          tabPane.putClientProperty("html", null);
          int xNudge = getTabLabelShiftX(tabPlacement, tabIndex, isSelected);
          int yNudge = getTabLabelShiftY(tabPlacement, tabIndex, isSelected);
          iconRect.x += xNudge;
          iconRect.y += yNudge;
          textRect.x += xNudge;
          textRect.y += yNudge;
       * A specific <code>MetalTabbedPaneUI</code>.
      class CloseableMetalTabbedPaneUI extends MetalTabbedPaneUI {
        * the horizontal position of the text
        private int horizontalTextPosition = SwingUtilities.LEFT;
         * Creates a new instance of <code>CloseableMetalTabbedPaneUI</code>
        public CloseableMetalTabbedPaneUI() {
         * Creates a new instance of <code>CloseableMetalTabbedPaneUI</code>
         * @param horizontalTextPosition the horizontal position of the text (e.g.
         * SwingUtilities.TRAILING or SwingUtilities.LEFT)
        public CloseableMetalTabbedPaneUI(int horizontalTextPosition) {
          this.horizontalTextPosition = horizontalTextPosition;
         * Layouts the label
         * @param tabPlacement the placement of the tabs
         * @param metrics the font metrics
         * @param tabIndex the index of the tab
         * @param title the title of the tab
         * @param icon the icon of the tab
         * @param tabRect the tab boundaries
         * @param iconRect the icon boundaries
         * @param textRect the text boundaries
         * @param isSelected true whether the tab is selected, false otherwise
        protected void layoutLabel(int tabPlacement, FontMetrics metrics,
                                   int tabIndex, String title, Icon icon,
                                   Rectangle tabRect, Rectangle iconRect,
                                   Rectangle textRect, boolean isSelected) {
          textRect.x = textRect.y = iconRect.x = iconRect.y = 0;
          javax.swing.text.View v = getTextViewForTab(tabIndex);
          if (v != null) {
            tabPane.putClientProperty("html", v);
          SwingUtilities.layoutCompoundLabel((JComponent) tabPane,
                                             metrics, title, icon,
                                             SwingUtilities.CENTER,
                                             SwingUtilities.CENTER,
                                             SwingUtilities.CENTER,
                                             //SwingUtilities.TRAILING,
                                             horizontalTextPosition,
                                             tabRect,
                                             iconRect,
                                             textRect,
                                             textIconGap + 2);
          tabPane.putClientProperty("html", null);
          int xNudge = getTabLabelShiftX(tabPlacement, tabIndex, isSelected);
          int yNudge = getTabLabelShiftY(tabPlacement, tabIndex, isSelected);
          iconRect.x += xNudge;
          iconRect.y += yNudge;
          textRect.x += xNudge;
          textRect.y += yNudge;
    }The Listener:
    import java.util.EventListener;
    * The listener that's notified when an tab should be closed in the
    * <code>CloseableTabbedPane</code>.
    public interface CloseableTabbedPaneListener extends EventListener {
       * Informs all <code>CloseableTabbedPaneListener</code>s when a tab should be
       * closed
       * @param tabIndexToClose the index of the tab which should be closed
       * @return true if the tab can be closed, false otherwise
      boolean closeTab(int tabIndexToClose);
    }

  • POPUP_TO_DISPLAY_TEXT but with warning icon

    Hi there ABAP-people, I've got simple question ...
    ... how can I do simple popup window with:
    - warning icon
    - message
    - button (OK, proceed or sth)
    I see there is a 'POPUP_TO_DISPLAY_TEXT' but it has 'INFO' icon...
    there is a 'POPUP_WITH_WARNING' but ahve no warning ...
    maybe You have some tip?  I'd be thankful for help. Greetings. P.

    hi piotr,
    al are having options for your question.
    use the best suitable for you..
    POPUP_TO_CONFIRM_STEP - Create a dialog box in which you make a question whether the user wishes to perform the step.
    POPUP_TO_CONFIRM_WITH_MESSAGE - Create a dialog box in which you inform the user about a specific decision point during an action.
    POPUP_TO_CONFIRM_WITH_VALUE - Create a dialog box in which you make a question whether the user wishes to perform a processing step with a particular object.
    POPUP_TO_DECIDE - Provide user with several choices as radio buttons
    POPUP_TO_DECIDE_WITH_MESSAGE - Create a dialog box in which you inform the user about a specific decision point via a diagnosis text.
    POPUP_TO_DISPLAY_TEXT - Create a dialog box in which you display a two-line message.
    POPUP_TO_SELECT_MONTH - Popup to choose a month
    POPUP_WITH_TABLE_DISPLAY - Provide a display of a table for user to select one, with the value of the table line returned when selected.
    POPUP_TO_CONFIRM - Pop-up dialog confirm an action before it is carried out.
    POPUP_TO_DISPLAY_TEXT - Displays a text in a modal screen
    POPUP_TO_INFORM - Displays several lines of text. No OK or Cancel buttons.
    Regards,
    Prabhudas

  • Text with slide show

    I saw a slide show that I think was made with iDVD that had text identifying the photo. Was this something done with software like Photoshop? I can find nothing in iDVD that would allow me to insert text with a photo.
    Also during my first attempt of putting in photos from iphoto I got a notice that I could only put in 30 photos. Consequently I put in sub menus creating three sections for 90 photos. It know seems that I didn't need to do that as it appears that you can use 99 photos. I can't remember the sequence of events that prompted the notice of 30 photo maximum but it did happen.
    Doug

    Hi Douglas
    To Your first question. Yes I would bet on that it was done with PhotoShop™
    or any other photo editing program.
    Your second: Dont know. I use iMovie to make my slideshows and here
    there are no limit and a much higher controll over the presentation. You
    could even put text on Your photos here but in a rather crude way.
    BUT - there are lots of people saying that there is a resolution loss this
    way. I think that it has to do with how You go from iMovie to iDVD (not
    via the Share/Export to iDVD from within imovie - but - just drop the
    project icon into an open iDVD theme window).
    Yours Bengt W

Maybe you are looking for

  • Cant enable ePrint web services for Color LaserJet M551

    Hi, I've read all posts in this forum about the ePrint web services enabling issue and tried out all suggestions with no luck. Here is the situation: The printer works fine locally. I can print without problem. The printer is wired. All ports in my r

  • Itunes wont sync iphone because of apps

    I was listening to music with the lock screen on when all of a sudden i got a text, i went to open my text my phone showed the apple logo. it dose that every once in a while so i just waited for it to turn back on as usual. this time it told me i nee

  • Can I change different background and font color on each records?

    Hi, I had a Data_Block which contains some records, I had a field name 'currency' which contains value such as (HKD, JPY, CNY, CND, USD etc..) Let there there are 5 Records contain in that Data_Block and I wanted to change the background and font col

  • Unknown artist and folder issue/itunes mac

    So, for some reason, some albums imported to itunes get sorted in "unknown artist/unknown album" folder on the harddrive. I mean, in itunes they are where they're supposed to, but they dont show up under the right artist folder in Finder/harddrive. I

  • Playlists and duplicates

    if i have songs in a playlist, and move both the playlist and the library onto my iPod...will i have duplicate copies of songs on the iPod, or am i just accessing the same song from two different places? PC   Windows 2000