Swing control name!?

Hi,
Im experimenting with swing at the moment and i really need to be able to add this item but i dont know what it is called!! The best example of it i can show is on this page;
http://www.apl.jhu.edu/~hall/java/Swing-Tutorial/Swing-Tutorial-LAF.html
Under "6. Example: Windows LAF (Sun SwingSet Demo)" , on the right hand side of the window, where is says "selection mode". The small line that goes around a set of other controls, in this case a combo box.
Does anyone know what this is called and how to add it to a Swing program!?
thanks for any help !!
Edited by: creman42 on Feb 26, 2008 11:10 PM

I can see now that a border can be added to a component quite easily!
Is it possible to make the border encompass more than one component though? Say, put a titled, etched border around two text fields? I thought it might be a 'compoundBorder' :-(
.

Similar Messages

  • How get controls name from a class private data?

    How can i get the names of the controls inside a class private data?
    I am using Actor Framework and trying to create a method tha will be executed when launch the actor. This method need a list o all the control names inside the class data to search for the initial value inside a configuration file (config.ini), the key on the configuration file will be the name of the control.
    Thanks.
    Solved!
    Go to Solution.

    You are already making the overriding method just because you have to write to the Bundle By Name.  And then how are you going to handle all of the data types the keys could be.  You are making things more difficult than it should be for really very little benefit.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Can I use Swing controls with Forms 9i?

    Is there a way to use Java Swing controls with Forms 9i via a PJC or something? If so, is there a white paper on it? Thanks.

    Yes you can. There is a quick start about PJC here:
    http://otn-stage.us.oracle.com/products/forms/htdocs/upgrade/pjc/content.html
    And there is also a paper about Forms in the Java World that you should read.
    http://otn.oracle.com/products/forms/pdf/forms_in_java_world.pdf
    You might want to have a look at the Oracle9i Forms Demos for some code samples as well.

  • Log file full of: No Control Name specified

    my oidldapd**.log full of these message every second.
    2002/06/15:01:26:17 No Control Name specified
    2002/06/15:01:26:17 No Control Name specified
    2002/06/15:01:26:17 No Control Name specified
    2002/06/15:01:26:27 No Control Name specified
    2002/06/15:01:26:27 No Control Name specified
    2002/06/15:01:26:27 No Control Name specified
    2002/06/15:01:26:28 No Control Name specified
    2002/06/15:01:26:28 No Control Name specified
    2002/06/15:01:26:30 No Control Name specified
    2002/06/15:01:26:30 No Control Name specified
    Is these normal or not? and what mean by Control Name?
    I cannot find these term in any document.
    OID version is install with oralce 8.1.7
    Thanks

    Hmm... dunno what I did but I no longer suffer from this.
    # cat lxdm.log
    ** Message: find greeter (nil)
    ** Message: find idle (nil)
    ** Message: add xserver watch
    X.Org X Server 1.12.2
    Release Date: 2012-05-29
    X Protocol Version 11, Revision 0
    Build Operating System: Linux 3.0.32-1-lts x86_64
    Current Operating System: Linux simplicity 3.4.2-3-ck #1 SMP PREEMPT Wed Jun 13 04:12:07 EDT 2012 x86_64
    Kernel command line: BOOT_IMAGE=/vmlinuz-linux-ck root=UUID=ae7fd835-eb80-3a45-9cf8-aab9d51bdad5 ro quiet init=/usr/lib/systemd/systemd
    Build Date: 30 May 2012 07:24:13PM
    Current version of pixman: 0.26.0
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
    Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    (==) Log file: "/var/log/Xorg.0.log", Time: Fri Jun 15 05:24:16 2012
    (==) Using config directory: "/etc/X11/xorg.conf.d"
    ** Message: add 0x80d3b0
    ** Message: prepare greeter on :0
    ** Message: start greeter on :0
    ** Message: greeter 121 session 0x80d3b0
    ** Message: user 121 session 0x80d3b0 cmd USER_LIST
    /usr/bin/startxfce4: X server already running on display :0
    xfce4-session: GNOME compatibility is enabled and gnome-keyring-daemon is found on the system. Skipping gpg/ssh-agent startup.
    Error: No such tab mode: chat
    -- Exception object --
    + fileName (string) 'chrome://messenger/content/tabmail.xml'
    + lineNumber (number) 465
    -- Stack Trace --
    openTab("chat",[object Object])@chrome://messenger/content/tabmail.xml:465
    get_selected()@chrome://messenger/content/chat/imconv.xml:121
    ()@chrome://global/content/bindings/richlistbox.xml:576

  • To compare control name with a variable

      Hi all
    I want to compare the name of a control with a variable inside a loop. Is there any function for it in Labview? Please let me know if it is.
    Thanks in advance
    Solved!
    Go to Solution.

    Hi ghighuphu,
    I am attaching an example VI for our objective. 
    In the VI we are giving 5 'Variable names', 5 'Variable values' as inputs. And also we are giving an array consisting of the 3 required  'control names'(These 3 controls are on the right side of block diagram). First we are getting only the 3 required values from available 5 values. Now we want to pass these 3 values to their corresponding controls named a,b and c on the right side of the block diagram. So that they can be added and give the output.
    I want a generalised solution so that it works for varying number of controls.
    Attachments:
    Linking1.vi ‏11 KB

  • Labelling wires can be made easy ..!! Take the control Name as default - Label Name for wire

    Wire : Right Click --> Visbile --> Label  (Its void Now )
    Solution : It can take the control Name as default label of the wire,  instead of  being Void
    Not sure if this idea is already proposed. 
     

    sandyy wrote:
    Ya true, in the above case it should take the indicator Label
    It's just as easy to construct a case where there are multiple sinks to the wire and then you can't just say "take the indicator label". My point was that I don't want NI spending time on figuring that out and writing that code.
    As for your second example, now there's suddenly even more magic in there - The wire labels somehow gained the brackets and the wires which have an uninitialized shift register as a source somehow know that they should take the labels from other wires in the loop.
    If you think the logic for this is simple, you can try writing a Quick Drop shortcut which will do this - for all selected elements which are wires, go find their ultimate source and take its label and apply it to the wire. I think if you try that you'll appreciate why I don't want NI to spend time on this. You might also find that the tool you wrote works well enough for you and you can use it right now without having to wait for NI.

  • Tutorial on AWT/Swing control flow

    Greetings all,
    Just wondering if any of you folks know of a good tutorial on AWT/Swing control flow? I'm doing some pretty complex stuff with a table whose editors call other windows and insert values into the table based on callback objects...weird stuff happening with loss of focus when the other windows come out, etc etc etc.
    I have it working via a series of what I consider kludges, but I would really like to implement it cleanly, and it's looking like that's going to require understanding <ugh> <grin>
    So it looks like it's time that I bit the bullet and got to grips with control flow in AWT/Swing. Is there a tutorial out there that could help me with this?
    Many TIA

    skiaddict1 wrote:
    Let's take your word for it, but if you have the slightest doubt please consider the subject: EDT violation is a classic here.OK sure, but I really don't think I'm violating it. I avoid multi-threading like the plague, and only introduced it for my report writer because I wanted to have a little window advising the user that the report was in the process of being written.Raise your left hand and swear this report writer is not running when you experience the problem you describe! >o(
    OK, this is just kidding, as per the rest of your description, it sounds reasonable now to assume that your problem is not related to EDT violation.
    I'm doing some pretty complex stuff with a table whose editors call other windows and insert values into the table based on callback objects...This summary is a bit worrying, and I thought you would mention problems in the display of the table being edited. But you seem to refer to problems in other windows, or did I misunderstand?
    Or do you mean, loss of focus in the editor still being edited? Can you please clarify what you do and what your problems are?
    In particular, what does the other windows come out mean?OK, I was trying to be sparse with details because I didn't think they were relevant.Actually the worrying seems all the more justified, now that you have described it more extensively: I was afraid that you would raise other windows while editing, and that's the case. I know little of focus though...
    I have a table in window A, one of whose columns has a custom editor which, when a cell in the column is double-clicked, registers itself with window B as a choice-listener (see later) then asks window B to come to the front. Window B, when the user performs a choice amongst the UI elements in there, fires a choice-event to its listener, i.e. the custom editor. At which point the editor saves away the chosen value (for use by getCellEditorValue()), sets the text in the cell appropriately, turns edit mode off via fireEditStopped(), and brings window A back to the front.
    (...) once the custom editor asks window B to come to the front, the table in window A loses focus and when it is brought back to the front, the table's JScrollPane seems to have the focus (visually, it has the focus rectangle around it). Pressing the Tab key has no effect on focus; you have to use the mouse to focus something.I assume you have read the tutorial on using tables in Swing.
    It contains an example where a custom editor is bringing up a dialog: http://download.oracle.com/javase/tutorial/uiswing/components/table.html#editor
    AFAIK, the example does not suffer from focus problems.
    What I am finding, and I reiterate this is new since I rewrote the windowing subsystem for the app (the custom editor was not changed in the rewrite), is that (...)Just what do you call "rewriting the windowing system" (just to rule out the possibility of something Ramboesque)?
    I have no idea why this loss of focus is occurring, and I am at a loss to begin to figure it out. As I wrote above, I have a series of kludges which gets around the symptoms, but I would really rather figure it out and fix it.OK I admit I cannot tell what happens exactly, but:
    1) instead of bringing window B to front, couldn't the editor bring up a dialog B (e.g. using JOptionPane.showXxxDialog() to bring up just the choice panel? The advantage is that it is more "synchronous", you can control when the window A's table model is updated.
    2) what worries me too is that you update the model of the table being edited while you're editing one cell of it? Would it be possible, and make sense in your case, to update this model later (that is, post the model update as an invokeLater(...) call)? I don't see how seeing the table updating underneath helps the user editing its cell, but you may have your reasons.
    What do you call flow control , or control flow in AWT/Swing?Basically, what I am after is something that will help me begin to understand/diagnose problems such as the above when they happen in my code. I am deeply averse to multi-threading (...) Things in my code were working, and that was enough for me.
    But the above behaviour, and another weird behaviour I was having last week, which again I have solved with what I consider a kludge, and again which only began with my new windowing subsystem, have caused me to realise that it's time I really got to grips with this issue.Yes, when they say beware of threads when using Swing , nobody tells to not use threads! Just to be aware of how special Swing is with regards to threads (at least, compared to AWT, that didn't make such warning).
    I would like, for example, to really deep-down understand exactly when listeners for AWT-Swing events get called. I don't really care so much when the events get put on the queue, but I do care when exactly my event handlers will be called. This will help me diagnose problems, I'm sure.Well they get called in the EDT, by some framework code that, in an infinite loop, does something along the lines of:
    - pop next event from the event queue
    - determine which is the target widget
    - let the widget transform the event and send it to all registered listeners
    Now with dialogs, things gets dimmer, because while a dialog is brought up (via a<tt>setVisible(true)</TT> call on the EDT, the EDT is indeed suspended, and a new event thread manages the events for the dialog).
    I'm sorry I have no reference for that behavior, and my description is certainly blurry (and possibly wrong), but I don't think your problem is so much related to threading as I initially thought.
    N.B.: Darryl's second link does features sequence diagrams that try to demonstrate what happen (in a specific example with asynchronous access, but you can derive the simpler, regular, working, from it).OK, yes I saw that diagram, I was offput by the asynchronicity but I will have another look tomorrow also. Thanks againDon't put too much hopes in there, indeed it's definitely not the kind of info I understand you're looking after.
    Much luck all the same, and feel free to come back with your findings, or with more questions, about the initial subject (reference on event flow) and the specific problem (your focus issues with the editor).
    I also cannot end this message without suggesting that you try to reproduce the problem with an SSCCE (http://sscce.org), that you could post here for us to try out. See this recent discussion about the multiple interests of this approach: {message:id=9587964}
    Best regards,
    J.

  • Looking for Swing control like Explorer Bar

    Hi folks,
    on Win XP you have in the Windows Explorer (file mode) on the left side this nice column showing additonal information about the selected file like creation date or a thumb of an image file. You can expand and collapse the information panels by clicking on an arrow icon in the head of the panel.
    I haven't seen such a control for Java Swing. Maybe there is one but I'm searching with the wrong key word.
    Any ideas?
    Sebastian

    I believe that a JTree with customized renderers
    would bring you something close to what you expect.No, this would be a dirty hack. I was thinking more about a layout with several cells and in each cells some kind of control. Still I was hoping that something like that already exists.
    Sebastian

  • Tab control name editing

    In my application i am using tab control . 
    For that i want to programatically change tab names and i want to enable and disable a specific tab .
    In property i cant find this option and in discussion forums i could not able to open the vi mentioned in the link 
    http://forums.ni.com/t5/LabVIEW/Change-values-of-Tabs-on-Tab-Control/m-p/677900#M311358 
    What might be the problem .
    Thank you
    Raja
    Solved!
    Go to Solution.

    You are have your answer concerning enabling and disabling tabs. Concerning the first part of your question you can not dynamically change the names of tabs at runtime. The reason is that logically tabs are enumerated with the tab names being the enumerations. In other words the names aren't properties that you can change, they are part of the datatype.
    Now what you can do is use a combination of buttons and enabling/disabling controls to simulate the appearance of a tab control - which might not be a bad idea given the problems that tabs can cause.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Create custom swing control

    Hi,
    I'd like to create my very own swing component. It isn't just a modification of an existing one but rather a group of existing components (JButton, JProgressbar, JToggleButton) that interact. Is there a way to do this with some kind of visual editor like you can crate a custom control in the Visual Studio .Net?
    Kind regards,
    Stijn

    arrrghh did you say "Visual Studio .Net"
    aaargh did you say "visual editor"
    just kidding...
    You can combine different JComponents in a container component...JPanel would be the most suitable I think... So you just create a class myCustomComponent... which extends JPanel... If you want, you could give some parameters through the constructor..
    ... and there you go... new myCustomComponent("This could be heading text"); will create your "custom component"...
    There are visual editors... (jbuilder has one, lots of IDE's have visual editors these days) But beware of:
    - the auto-generated code (lots of overhead)... hope it works...because you dont want to debug this code
    - (not all but) most dont use layoutmanagers (the way they should) meaning you are creating "Visual Basic" applications (every component has fixed size, no matter what resolution, framesize, etc)
    - most important...you dont learn how to work with swing !
    V

  • Problem getting handle of swing controls

    Hello there,
    I have an application developed using Swing.
    Handle of only the main container is obtained using tools like spy++ etc..
    But the other controls such as JButton etc. is not shown.
    I want to host this in a C# panel.
    Is there any API or something available for this.
    Please can anyone help.

    I guess as awt uses windows graphical components it can be found out easily
    but swing is independent of the OS.Read the first sentence of my response at #2. No software is "independent" of the OS. Lightweight components are painted in the window of the heavyweight ancestor, hence have no window of their own.
    The nearest advice I can give for your requirement is to research the methods of SwingUtilities particularly convertPointFromScreen(Point p, Component c) and getDeepestComponentAt(Component parent, int x, int y).
    db

  • Control names load from file

    Is there a way to load a control (i.e. boolean switch) name from a file?
    Here is my situation. I have 4 selector toggles, and a go button. Picking a selection and pressing go will send an array of four binary numbers (true or false converted to 0 or 1) to a sub vi called command_former.
    This program is simple. It first loads up a library file with pre-made sequences of bytes which correspond to each button. It outputs an array that includes the appropriate byte sequences concatenated onto one another if the selector toggle is set to 1.
    By loading the values from a file, it easily lets the user change what the selector toggles do. But I do not know how to change the name to also load from a file.
    Solved!
    Go to Solution.

    You cannot change the name of a control at run-time. You can, however, change the caption. For Boolean controls if you want to change the text that appears in the middle of the control this is done via the BooleanText property node. See https://decibel.ni.com/content/docs/DOC-22669 for a simple example.

  • MYSQL Array Assigned to Swing Control

    I am having a hard time figuring out, how I assign data from an array to a swing object such as a "scroll pane". Below is my query and I see how to assign an individual value to a scroll pane, but how would I assign all the values from my query to the scroll pane and put each value on a different line?
    statement s2 = conn.createStatement ();
                   s2.executeQuery ("SELECT stuff FROM  mydatabase");
                   ResultSet rs2 = s2.getResultSet ();
                   int count2 = 0;
                   while (rs2.next ())
                       String stuffVal = rs2.getString ("stuff");
                   ++count2;
    stuffscrollbox.setText ( "$" + stuffVal);Edited by: crusherdestroyer on Jan 18, 2010 1:58 PM

    hii,
    I can not hepl you, cos I never used these JComponents, but maybe here is your "result"
    [http://java.sun.com/docs/books/tutorial/uiswing/components/textarea.html]
    or
    [http://www.java2s.com/Code/Java/Swing-JFC/CatalogSwing-JFC.htm]
    ... kopik

  • Swing Control Suggestions

    I have a project that contains multiple forms of data that I want to be connected and scrollable.
    The data would be two strings of characters, a string of numbers that is the position of the character string, and XY chart/graph of data. The problem with the XY data is that it has more data points than the character string. So for position 5 in the string the data, the XY data that cooresponds would be postions 33-45, and for position 6 in the string data it could coorespond to positions 46-50. I want a scrollable marker that displays over the strings and XY charts to show the data for particular positon.
    Tried to show an example below, a picture of trace with out the markers can be seen : http://biophysics.uoguelph.ca/images/facilities/dna.gif
    Text Example:
    ...............5............... |10|............... 15
    A C A A C G T A G| A | T A G G G
    A C A A C G T A G| A | T A G G G
    | -----------------------|.....|---------------
    |................................|.....|
    |................................|.....|
    | >>>>>>> xy graph here >>>>>>>
    |................................|.....|
    | -----------------------|__|---------------
    ................................. ||
    ...............................Marker
    Any suggestions on what to use to do this?
    Tried to fix the graph
    Message was edited by:
    jschneid
    Message was edited by:
    jschneid

    This sounds tricky to me. Maybe I'm wrong and there is an easier solution, but I think that you will have to make two canvas fields, and render into them individually. Afaik there are also Convencience Methods to draw Text. Then you have to implement some MouseClick() or MouseDrag() Listener, which reads at the least the y coordinate from your upper field and refreshes the view in the second canvas accordingly.
    Edit: afaik canvases don't implement the scrollable interface, so if you want to make something scrollable, you should create a panel, add scrollbars to it, and insert into the panel your canvas. See the sun tutorials for further infos about scrolbars..

  • How to get the name of a duplicated control or created control and add a callback to it

    Hi All,
    Depending on how many input points I need, I am duplicating a numeric or string input with the DuplicateCtrl function. My question is, how do I get the name and id of the control that was just created, and how can i assign a callback to it? Alternately, would it be better to create a fresh ctrl instead of duplicating?
    Thanks in advance!
    Solved!
    Go to Solution.

    Hi TurboMetrologist,
    why are you trying to get the control constant name? Keep in mind that you cannot use that name to address the control; control names are actually simply macros in the include file associated to the UIR, that is, the compiler preprocesses the code and wherever it finds PANEL_CONTROL names substitutes the corresponding numeric value as parameters to the functions (and consequently 'control' parameter is an int and not a char*)
    That is why NewCtrl () or DuplicateCtrl () functions return a control ID: it is the handle to the new object, our only way to manipulate it. You will need to store this handle into a non-volatile memory so that you can access it durng program life.
    Additionally, there are other ways to assign some particular meaning to a control than swiching on the control constant name. You could for example use the callbackData parameter to differentiate between different copies of a control.
    Let me explain with an example. You told that you need several inputs (dynamically created as you don't know in advance how many of them to use); a clean solution could be to:
    Design a master copy of one control in the UIR editor, where it is easy to customize it; assign also a callback function, if it has to be common to all copies of the control
    Programmatically assign a callbackData value to that control, e.g. SetCtrlAttribute (..., ..., ATTR_CALLBACK_DATA, (void *)1);
    Duplicate the control and then assign a different callbackData
    for (i = 2; i < 5; i++) {
       handle = DuplicateCtrl (...);
       SetCtrlAttribute (..., handle, ATTR_CALLBACK_DATA, (void *)i);
    By operating this way, every time the control callback is fired by any control it will receive the assigned callbackData, and you will be able to differentiate your code by a simple switch:
    switch ((int)callbackData) {
       case 1:    // The master control
          break;
       case 2:    // The first duplicated control
          break;
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

Maybe you are looking for