JTabbedPane API too primitive??

hello,
does anyone else out there wish for a variant of JTabbedPane.addTab()
that looked like this?:
public void addTab(Component tab, Component body);
with such a method, one could pass in a jlabel for the tab component and therefore
have complete control over the placement of the icon (and whether an icon should
be displayed on the tab). but this is trivial compared to the need to put, say a close
button on a tab (possibly selectively) by passing a button as the tab component,
or a panel composite. another example of what i really want to
do is the grafting of a jpopupmenu on a jlabel that i use as the component for the
tab so that the tab can actually represent something tangible in my business domain
and domain actions exposed via the jpopupmenu.
i just skimmed a thread on a customization/extension to jtabbedpane to allow for
a "close tab" button ('x') on each tab:
http://forum.java.sun.com/thread.jsp?forum=57&thread=337070
i'm trying to avoid having to do something so complicated.
- has this issue been brought up before? (i did a quick search but did not find)
- if anyone from sun is listening, are there plans to add such a feature to 1.5/tiger?? (i assume
it's probably already too late)
is there a jtabbedpane extension out there that provides such a feature?
thank you!
/ eitan

Actually, this is something that was supposed to show up in Tiger: a JTabbedPane that used arbitrary components as the tabs. But they dropped the idea, apparently at the last minute. They also failed to make the improvements to the Actions architecture that they had been promising. I'm sure they have good reasons, but it's hard not to feel betrayed...

Similar Messages

  • Acceleration API in Parallels with SLS guest (and Rosetta support)

    Hi,
    after reading a lot about Rosetta's support to get it to work on my brand new MacBook Pro, I bought Parallels 8 in a Bundle and a copy of Snow Leopard Server from Apple to install on it and finally get Rosetta working. Great !
    But...
    A lot of my PPC apps won't work. Paralles support explains : "There's no hardware acceleration for OS X guests. Apple doesn't open their API so Parallels can write the drivers.". OK, sorry not to have known that before ! I understand Apple wants to protect their soft.
    I also read that Apple sells different versions of Parallels.Maybe so there is a version that does support acceleration API?
    Thanks for your help

    Apple doesn't focus on keeping old software and old hardware going and never really has, so the usual recommended course is to migrate off of the PPC software and to more recent and native applications. 
    As an option, keep an older Mac around and screen-share with it pending retirement of the PPC software.
    Whether the PPC software failures are due to bugs in the virtual machine (fairly unlikely, but possible) or due to latent timing or other bugs in the application code, or due to bugs in the Rosetta image translation itself, would require research into the apps and the failures.
    As for the question, I see no reason to doubt what the Parallels support folks have stated; that there's no documented API for the hardware accelleration — though whichever particular hardware support for accelleration isn't clear.   Hardware accelleration for VM guests is usually a reference to the Intel chips and the associated VM assists present in recent versions of those chips, but the references to drivers implies this might possibly be a reference to graphics drivers or otherwise.
    I'd expect Parallels would know about other versions of Parallels, so I'm not sure where that's headed.  I'd expect the same limitations would also effect VMware, if they're also following the documented APIs, but it might still be worth a try, to see of the translated PPC applications work there; if this is a Parallels bug, or something else.
    Using undocumented APIs means the applications can break at random OS X patches and upgrades, too, and that's something most large-volume vendors want to deal with, too.
    Coding applications directly to the drivers or bypassing the operating system entirely and going directly to the hardware is how Microsoft and their third-party providers got into their current mess with compatibility with Windows software for older versions of Windows, FWIW.  Various vendors bypassed the Windows software stacks, an approach which has led to legions of compatibility and security issues for Windows users over the years. 
    If anything, OS X is headed the other direction here entirely with sandboxing and gatekeeper and trying to keep applications to specific and documented APIs, too.
    FWIW...

  • Adding tab in JTabbedPane

    I'm confused as to how to add a tab. This is the code I wrote (I got it from my textbook):
    JTabbedPane tp = new JTabbedPane();
    tp.addTab (listName, new BorderPanel());
    And this is the error I am getting:
    cannot find symbol
    symbol : method addTab(java.lang.String,BorderPanel)
    location: class javax.swing.JTabbedPane
    tp.addTab (listName, new BorderPanel());
    I've imported the following into this file:
    java.awt.*;
    javax.swing.*;
    javax.swing.border.*;

    Read the JTabbedPane API for a description of all the methods and the parameters they accept.
    You will also find a link to the Swing tutorial on "How to Use Tabbed Panes" which has a working example.

  • Oil 5.2:No SCORM API calls in java trace file

    Hi,
    I am running a java trace for SCORM 2004 course. I don't see any SCORM api calls or cmi variables in the java trace (initialize(""), setvalue, getValue etc..). The course is set to tracked and the DEBUG is ON. Is the SCO communicating with the LMS?
    I have tested other SCORM 2004 courses, and they do show api calls in the java trace file.
    Oracle ilearning 5.2; Course: SCORM 2004
    Appreciate your help.
    Sud

    Scott,
    I have used Forefox v20, java6 and the firebug for debug purpose. I didn't see any errors in the console. But, I did find some lines in red (errors) under DOM tab. Here is the output.
    g_strAPIInitFailed     "Found API but LMSInitialize failed."
    g_strAPINotFound     "Management system interface not found."
    g_strAPISetError     "Trying to set value but API not available."
    g_strAPITooDeep          "Cannot find API - too deeply nested."
    g_strAPIVersion          "cmi._version"
    g_strDisableErrorMsgs     "Select cancel to disable future warnings."
    g_strFSAPIError          "LMS API adapter returned error code: "%1"
                   When FScommand called API.%2
                   with "%3""
    Thanks
    Sud

  • Facebook auth for web api REST implementation

    Is it possible to use the OOB experience when creating a web REST API project like a website? It was easy enough to incorporate the FB redirect for a generated site, but I'd like to use same authentication for a REST API too?  Is it possible to use
    the components provided by VS project but not do a redirect to FB but rather return a error to calling client?  What would the calling client need to include to the REST API in order for the authentication to work? Is this possible to do?

    Hi sir,
    Yes, you can use FaceBook as an ACS Identity Provider in your project. I suggest you can refer to this document.
    https://msdn.microsoft.com/en-us/library/azure/gg185967.aspx?f=255&MSPPError=-2147217396
    Also, there is a code sample about REST service Authentication with ACS, you could download it and refer to it:
    https://code.msdn.microsoft.com/vstudio/AAL-Native-App-to-REST-de57f2cc
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • JTabbedPane resize problem

    I have a JTabbedPane in a JPanel (BorderLayout.CENTER).
    That JPanel is the content component of a JOptionPane.
    The JOptionPane is in a JScrollPane which is in a JDialog.
    When the JDialog is resized (larger), the JTabbedPane enlarges too as desired.
    However, when the JDialog is resized (smaller), the JTabbedPane does not reduce in size consistently as one would wish.
    Any one know why, have a solution, etc.
    Any ideas appreciated.
    Thanks.

    I am using gl4java's GLAnimCanvas as the canvas based object in my application. Since
    the Swing based gl4java object is not hardware accellerated, it is way to too slow for my application
    (a 3D gui ).

  • About JDBC API

    "The JDBC API contains two major sets of interfaces:
    the first is the JDBC API for application writers,
    and the second is the lower-level JDBC driver API for driver writers.
    Applications and applets can access databases via the JDBC API using pure Java JDBC technology-based drivers."
    You can read this in the sun web site.
    When I have downloaded a jdbc driver for mysql database
    I have looked for source code and found those classes that implement the different interfaces belonging to package java.sql:
    at this point I imagine that this driver implements the first of the two interfaces in the previous sentence.
    I have not understood when the driver API for driver writers enter in this schema and if the second interface is anyway necessary for interact with the database: I would think that the second interface is necessary and is built with the driver API for driver writers, API that I have never seen.
    What do you think about this?

    I was thinking the same but now I am not so sure.
    Are you sure that API that belong to JDBC Driver API are not simply those concerning the driver manager?
    Anyway, when I download the driver in order to speak with the database, are there JDBC Driver API too?
    If you had reason, and the second volume of my official tutorial seems confirm this, the two interfaces would be completly separate.
    And I can not imagine a API that help me writing a driver for any database. Which type of help could give me?

  • OracleSOAComposite Listing using SOA API

    Hello,
    I have developed a java utility that lists the Components and its status using the JAVA APIs. I get results for most of them using COMPOSITEINSTANCE. But unfortunately, most of the APIs such as,
    CompositeInstance.getAuditTrail()
    CompositeInstance.getCreator
    CompositeInstance.getModifiedDate();
    are returning null whereas the CompositeInstance.getECID(), CompositeInstance.getID() and others are returning the value properly.
    Do we need to do something to populate them (audittrail, creator) similar to setting Title, because when you set the title using ora.setCompositeInstance it gives the value, similarly do we set those things in the composite for the JAVA API to retrieve. Kindly help.
    ANother thing, when I use FaultFilter,
    FaultFilter fltFilter = new FaultFilter();
    fltFilter.setECID(cmpInstance.getECID());
    String strFaultName = fltFilter.getFaultName();
    int [] nfltTypes = fltFilter.getFaultTypes();
    Even though the instance STATE returns FAULT, but the above strFaultName returns NULL.
    Kindly help. .
    Edited by: cdmnagaraj on Jul 28, 2011 7:24 PM
    Edited by: cdmnagaraj on Jul 29, 2011 5:38 AM

    THanks Anuj.
    But there is an API in the CompositeINstance to provide this Audit Trail as well. Any reason why Oracle has given it ? It is not even inherited method. But will try using getBindingComponents and use those APIs too.
    But no luck, kindly let me know even the FAULT is NOT returning, it says null. Probably the Faults have to be at COmpoSITe level, only then it will come up.
    Edited by: cdmnagaraj on Jul 29, 2011 8:54 PM
    Edited by: cdmnagaraj on Aug 8, 2011 3:08 AM

  • How to change the tab of a jTabbedPane when action performed

    The scenario is like this : I have a jTabbedPane with 2 tabs. I want, when an action is performed in one tab (for example a button is clicked on tab1) to change the tab automatically (to make tab2 visible). How can i do this?
    Thank you in advance

    I've read JTabbedPane API before i post the message, but unfortunately i couldn't find a solution to my problem. I tried to use the methods grabFocus and requestFocus to change the focus of the application, but it didn't work.
    Thank you for replying Nether.

  • Security API help needed / howto list user in group

    Hi there,
    i have tried all example programs of the hyperion security api. hard work to correct the errors in these scripts.
    now i can create native groups an users and can create groups on groups or put users in native groups.
    i have read the java doc / reference for the security api too but its not possible for me to list users of a group (group reference by name).
    is there anybody who can help with a code sample to list users of a group like "testgroup" ?
    something like (...getGroups(context,"testgroup")...) ??
    Best Regards
    Kai

    Please don't cross-post. It is considered very rude to do that here:
    http://forum.java.sun.com/thread.jspa?threadID=5233033&messageID=9953169#9953169

  • Triggering methods when a user clicks on a tabb in a JTabbedPane

    triggering methods when a user clicks on a tabb in a JTabbedPane.
    How can it be done? what listener should i use?

    Well, after READING the JTabbedPane API, it appears
    there is an addChangeListener()[/i[ method, so my guess
    would be a [i]ChangeListener ?
    And the source for the ChangeEvent would be the JTabbedPane
    so you could then easily call getSelectedIndex() to find
    out which pane is selected.

  • Is the reflection API thread safe?

    The obvious answer would appear to be yes, however, I have not been able to find any supporting documentation.
    I need to call the newInstance(Object[] initArgs) method on the same instance of the Constructor class from multiple threads.

    Hi,
    without knowing the reflection API too well, my guess would be, you are ok. If several threads are
    just creating new instances and you are not modifying anything used in their constructors, no problem.
    However, if you have a thread changing some class variables that are used in turn by the constructors to
    initialize the instances, you are in trouble.
    In such a case, try to encapsulate read&write access to these variables in synchronized
    methods (setter/getter).
    Good luck!
    Pete

  • Regarding JTabbedPane

    How can we arrange the different Tab buttons vertically as a list Some thing like
    Tab1! !
    Tab2! !
    Tab3! !
    Message was edited by:
    EshaPrasad

    Read the JTabbedPane API. There's a method that will do it.

  • How to parse XML to Java object... please help really stuck

    Thank you for reading this email...
    If I have a **DTD** like:
    <!ELEMENT person (name, age)>
    <!ATTLIST person
         id ID #REQUIRED
    >
    <!ELEMENT name ((family, given) | (given, family))>
    <!ELEMENT age (#PCDATA)>
    <!ELEMENT family (#PCDATA)>
    <!ELEMENT given (#PCDATA)>
    the **XML** like:
    <person id="a1">
    <name>
         <family> Yoshi </family>
         <given> Samurai </given>
    </name>
    <age> 21 </age>
    </person>
    **** Could you help me to write a simple parser to parse my DTD and XML to Java object, and how can I use those objects... sorry if the problem is too basic, I am a beginner and very stuck... I am very confuse with SAXParserFactory, SAXParser, ParserAdapter and DOM has its own Factory and Parser, so confuse...
    Thank you for your help, Yo

    Hi, Yo,
    Thank you very much for your help. And I Wish you are there...I'm. And I plan to stay - It's sunny and warm here in Honolulu and the waves are up :)
    A bit more question for dear people:
    In the notes, it's mainly focus on JAXB,
    1. Is that mean JAXB is most popular parser for
    parsing XML into Java object? With me, definitely. There are essentially 3 technologies that allow you to parse XML documents:
    1) "Callbacks" (e.g. SAX in JAXP): You write a class that overrides 3 methods that will be called i) whenever the parser encounters a start tag, ii) an end tag, or iii) PCDATA. Drawback: You have to figure out where the heck in the document hierarchy you are when such a callback happens, because the same method is called on EACH start tag and similarly for the end tag and the PCDATA. You have to create the objects and put them into your own data structure - it's very tedious, but you have complete control. (Well, more or less.)
    2) "Tree" (e.g. DOM in JAXP, or it's better cousin JDOM): You call a parser that in one swoop creates an entire hierarchy that corresponds to the XML document. You don't get called on each tag as with SAX, you just get the root of the resulting tree. Drawback: All the nodes in the tree have the same type! You probably want to know which tags are in the document, don't you? Well, you'll have to traverse the tree and ask each node: What tag do you represent? And what are your attributes? (You get only strings in response even though your attributes often represent numbers.) Unless you want to display the tree - that's a nice application, you can do it as a tree model for JTree -, or otherwise don't care about the individual tags, DOM is not of much help, because you have to keep track where in the tree you are while you traverse it.
    3) Enter JAXB (or Castor, or ...): You give it a grammar of the XML documents you want to parse, or "unmarshall" as the fashion dictates to call it. (Actually the name isn't that bad, because "parsing" focuses on the input text while "unmarshalling" focuses on the objects you get, even though I'd reason that it should be marshalling that converts into objects and unmarshalling that converts objects to something else, and not vice versa but that's just my opinion.) The JAXB compiler creates a bunch of source files each with one (or now more) class(es) (and now interfaces) that correspond to the elements/tags of your grammar. (Now "compiler" is a true jevel of a misnomer, try to explain to students that after they run the "compiler", they still need to compile the sources the "compiler" generated with the real Java compiler!). Ok, you've got these sources compiled. Now you call one single method, unmarshall() and as a result you get the root node of the hierarchy that corresponds to the XML document. Sounds like DOM, but it's much better - the objects in the resulting tree don't have all the same type, but their type depends on the tag they represent. E.g if there is the tag <ball-game> then there will be an object of type myPackage.BallGame in your data structure. It gets better, if there is <score> inside <ball-game> and you have an object ballGame (of type BallGame) that you can simply call ballGame.getScore() and you get an object of type myPackage.Score. In other words, the child tags become properties of the parent object. Even better, the attributes become properties, too, so as far as your program is concerned there is no difference whether the property value was originally a tag or an attribute. On top of that, you can tell in your schema that the property has an int value - or another primitive type (that's like that in 1.0, in the early release you'll have to do it in the additional xjs file). So this is a very natural way to explore the data structure of the XML document. Of course there are drawbacks, but they are minor: daunting complexity and, as a consequence, very steep learning curve, documentation that leaves much to reader's phantasy - read trial and error - (the user's guide is too simplicistic and the examples too primitive, e.g. they don't even tell you how to make a schema where a tag has only attributes) and reference manual that has ~200 pages full of technicalities and you have to look with magnifying glas for the really usefull stuff, huge number of generated classes, some of which you may not need at all (and in 1.0 the number has doubled because each class has an accompanying interface), etc., etc. But overall, all that pales compared to the drastically improved efficiency of the programmer's efforts, i.e. your time. The time you'll spend learning the intricacies is well spent, you'll learn it once and then it will shorten your programming time all the time you use it. It's like C and Java, Java is order of magnitude more complex, but you'd probably never be sorry you gave up C.
    Of course the above essay leaves out lots and lots of detail, but I think that it touches the most important points.
    A word about JAXB 1.0 vs. Early Release (EA) version. If you have time, definitively learn 1.0, they are quite different and the main advantage is that the schema combines all the info that you had to formulate in the DTD and in the xjs file when using the EA version. I suggested EA was because you had a DTD already, but in retrospect, you better start from scratch with 1.0. The concepts in 1.0 are here to stay and once your surmounted the learning curve, you'll be glad that you don't have to switch concepts.
    When parser job is done,
    what kind of Java Object we will get? (String,
    InputStream or ...)See above, typically it's an object whose type is defined as a class (and interface in 1.0) within the sources that JABX generates. Or it can be a String or one of the primitive types - you tell the "compiler" in the schema (xjs file in EA) what you want!
    2. If we want to use JAXB, we have to contain a
    XJS-file? Something like:In EA, yes. In 1.0 no - it's all in the schema.
    I am very new to XML, is there any simpler way to get
    around them? It has already take me 4 days to find a
    simple parser which give it XML and DTD, then return
    to me Java objects ... I mean if that kind of parser
    exists....It'll take you probably magnitude longer that that to get really familiar with JAXB, but believe me it's worth it. You'll save countless days if not weeks once you'll start developing serious software with it. How long did it take you to learn Java and it's main APIs? You'll either invest the time learning how to use the software others have written, or you invest it writing it yourself. I'll take the former any time. But it's only my opinion...
    Jan

  • Wanna Begin J2me

    Hey dudes,
    I want to start mobile programming with j2me. I am new to java but i am an experienced php developer. so I started java tutorial a few days and i am now in the Swing section. I want to know that should I read this section and does swing make sense in j2me?
    and another question is: When I can start j2me books and references?
    Thanks in advance

    When you want to learn J2ME you should first consider what platform you are going to target.
    CLDC - MIDP
    This is for mobile device platforms. Resources are very limited but most phones have support for the newer versions (CLDC 2.0 and MIDP 2.0) of these API's with additional functionality. User interface capabilities for these platforms is very limited because you have to work with a very small screen, so no Swing or AWT. Development using these platforms is actually different than development using J2SE because you need to take care with resources; efficient and optimized programming is often needed for slightly larger applications.
    If you want to do mobile game programming I would advise you to take a look at J2MEPolish:
    http://www.j2mepolish.org/
    CDC
    This is generally for smartphones and PDA devices. CDC is built on top of Swing, but you can also use AWT (and that is generally a lot faster). Here is a list of possible JVM's, at least for PocketPC/windows mobile devices:
    http://www.berka.name/stan/jvm-ppc/java_for_pda.html
    If you want to develop for pocketpc devices I would look at the .NET compact framework in stead, it is fully featured and free. but that is just my experience, in my opinion java on PDA/smartphone devices is still too primitive to consider.

Maybe you are looking for

  • Album shuffle has stopped working

    My 2nd gen nano has stopped shuffling albums. It used to do that just fine but then stopped for no apparent reason. I have reset the iPod, cleared and restored it all to no avail. Repeat is not on. It won't shuffle songs either. It is otherwise compl

  • Playing album downloaded from limeware in itunes

    Have downloaded via Limeware( a file sharing facility) a complete album but cannot play it in itunes. track plays but there is no sound. ! appears next to details of the download. Haven't had any problems up to now. Anyone any ideas?

  • Playlist problem and related question

    Hi, Is it possible to create a playlist that contain all the songs that are located in a specific folder? What I did: Then iTune said that it was adding the songs but when it finished, the playlist was empty. Is something wrong with the installation

  • Problem In Scrolling

    Hi All I m usimg Flex Builder 3 Following are the dimension of my Application Layout : absolute width: 1024 height: 768 It has a panel with dimension Layout : absolute width: 990 height: 748 When the page opens in IE7 it doesnt show scrollbar neither

  • Existing Library Files flagged as Damaged after Move to new iMac

    Hi - I just upgraded my mid-2011 iMac to a late-2012 iMac. I have the iTunes library on a Thunderbolt Raid (Promise Pegasus) and have connected the Promise to the new iMac. I'm trying to get the 'new' iTunes to see and use the library on the Pegasus,