Need ideas on how to visually separate jtoolbars

Hi,
I have placed a JToolbar with 8 buttons (icon-only display) on top of my application.
However, I would like to visually separate the buttons and split them into 3 distinct groups. One solution could be the use of the setName() method, and the use of 3 JToolbars but it does not show while docked.
any ideas?

this might be one way
import javax.swing.*;
import java.awt.*;
class Testing
  public void buildGUI()
    JToolBar toolbar = new JToolBar("tools");
    toolbar.add(new JButton(new ImageIcon("test3.gif")));
    toolbar.add(new JButton(new ImageIcon("test4.gif")));
    JButton b = new JButton();
    b.setEnabled(false);
    b.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));//try 10,15 etc
    toolbar.add(b);
    toolbar.add(new JButton(new ImageIcon("test5.gif")));
    toolbar.add(new JButton(new ImageIcon("test6.gif")));
    toolbar.add(new JButton(new ImageIcon("test7.gif")));
    JFrame f = new JFrame();
    f.getContentPane().add(toolbar,BorderLayout.PAGE_START);
    f.setSize(200,100);
    f.setLocationRelativeTo(null);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setVisible(true);
  public static void main(String[] args)
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        new Testing().buildGUI();
}

Similar Messages

  • Need idea on how to do question and answer program

    I want to create a troubleshooting program where it asks the user questions until its drilled down to an appropriate answer.
    I've done this with a web server before but I can't seem to figure out how to do it in a program without involving many many forms. Any ideas on how to do the UI?
    Thanks!

    Building an expert system is not a trivial process so for a commercial app you'll need to do some research. For an internal app you should probably use a database. For a school project you can get away with storing the data in a file that is loaded into
    memory (or simply building the data in memory directly).  In any case you'll need to define a table of questions.  If you support questions with fixed answers then you'll need a separate table for the answers associated with the questions. 
    If questions can be different types (as mentioned previously) then you'll also need to track the question type with the question.  For the relationship between questions you can go different ways depending upon your requirements. If question 1 with answer
    A goes to question 2 but answer B goes to question 3 then you can create a simple reference table that indicates what the next question is given the current question and answer, basically a state machine.  If a single answer opens a whole series of questions
    then you might do better to group the questions together and manage the transition between groups of questions.  It really depends upon your requirements. You'll want to research state machines to implement this though.
    On the UI side you really don't need to dynamically create anything.  The only thing that changes between questions is the text and possibly the answer format (if you support multiple questions). As I mentioned earlier you can create a separate container
    (Panel) for each question type and then show or hide the container based upon the type of question (from your database data).  This eliminates the need to dynamically create the UI.

  • How to visually separate elements in a pre-recorded song?

    I'm hoping to use Audition in a research project to study patterns in music.  I just downloaded it last night and I'm using the trial period to evaluate if it will meet my needs.  I am running the program on a Mac.
    As stated above, I'm hoping to use Audition in a research project. to study patterns in music.  I need to be able to do this with pre-recorded songs (songs downloaded from iTunes).  I do not need to actually separate vocals or other elements (i.e. only hear one or the other), but I am hoping to be able to visually see the vocals, melody, base, drums, other accompanying instruments separate from each others (see their separate frequency waves).  So for example, I would like to visually see the main vocals increasing in volume, changing from low to high notes, seeing a note sustained for a period of time, and noting how these patterns coincide with other elements in the song. 
    I am very much a novice so I am not able to describe this in "music terminology".  I have seen the "frequency displays" when playing a song that show the right and left channels - but all the elements are merged together making it impossible to really visually see any patterns.  I've tried to play around with some of the options in the effects menu (Amplitude and Compression; Filter and EQ), but I have not found an option that provides what I'm looking for.
    Does Audition provide the feature I'm hoping for?  Can someone help point me in the right direction for achieving this?
    Thanks!!!!!

    Not really.
    The only way to have visually separate elements is to have each element separate.  They'd exist this way in the original recordings prior to the mix but, as soon as they're mixed trying to split them out is like "trying to unbake a cake" (to use a common forum cliche).  If you think about it, this makes sense--440Hz from a human voice is the same as 440Hz from a piano--so in the display (which is a mix of amplitude and frequency) they show up as the same.
    It MIGHT be worth you having a look at things in Spectral View.  This is a useful analytical tool for a lot of things and may show up some interesting stuff--but, even there, I doubt it would give all the info you want.
    This isn't an Audition limitation by the way...I don't know of any audio software that can "unbake the cake" as you need to.
    If it was me, instead of downloading finished songs from iTunes, I'd be approaching hobby musicians and asking/begging for copies of their original, pre-mixed tracks.  There are various home recording forums (indeed, one called "Home Recording") and some there might be able to help.  However, even with the original tracks, be aware that they don't necessarily show the levels graphically--typically there would be a display of the original track plus some sort of automation system (which may show you a line going up and down) indicating what is happening to the levels.

  • Need idea on how to replicate muti/multi choice form

    I am working on trying to "computerize" a set of NCR forms we use for Home inspections.
    So far, so good.  I have check boxes, radio buttons, and more....
    BUT...
    I have a lot of lines that are multiple/multiple choice entries that work fine on paper, but I can't figure out how to present them on a electronic form...
    Example:
    Oven/Cooktop
    [ ] Deterioration/Damage/Not Functional/Unsafe/Near End of Lifespan*
    [ ] Not Inspected (power/gas off) [ ] Upper/lower Element-burner - not functional [ ] Heavy Corrosion/Wear
    [ ] Recommend anti-tipping device (2) [ ] Gas shutoff valve not visible / none (2)(4)
    On paper, I could select (check) the initial box, then circle "Damage " and  "Near end of Lifespan"
    Without creating a checkbox for EVER option, does anyone have an idea about how to present these type multi-option options.
    I have 16 pages PACKED with choices like this.  Pull downs don't help me much, as then the user can't see all the options.
    We will use Pull downs for some of the canned comments, and other field type for simple (short) lists...
    PS...thanks to this forum I figured out how to have text fields appear & disappear based on check boxes. Anytime there is a *,2 or 4 I need a comment to appear on the summary page...now if only I can figure out how to make the summary page look nice with missing fields....

    One possible option is to use a button that trigger a pop-up menu to open,
    where the user sees all the options at once and can select one of them.
    This would require a bit of scripting, though, and the only advantage over
    a drop-down menu is that all the options are visible in a single window, as
    opposed to a scrollable list.

  • Need ideas on how to return display back to normal

    Any suggestions on how to return the display back to normal setting on my Mac OS X, my cat "pawed something on the keyboard and now everything is stretched so big I have to scroll way down to get to the dock and way over to see what's on the sides.  Then my daughter tried to fix it and the display is now a square center with the black sides cut off.  Any idea are greatly appreciated!

    First try opening the Universal Access System Preferences and check the'Seeing' options. It's possible that the 'Zoom' option has been enabled. If that's what happened then you should be able to hold down the command and option keys, then press the '-' and '=' keys to zoom the image in and out. Hopefully that is all that is needed.
    You should also check the Display System Preferences to make sure that you are set to the native resolution of your panel (should be the highest highest resolution listed).

  • Need idea on how to implement this - repeating monthly data on day level

    Hi all, i had run into the following thing, this may soung easy, but i'm searching for the best solution:
    i have a dataset per the stores of the customer, the dataset is an asset count on the end of the specific month. I must not sum the data between two/N months.
    We they need to do several querries like
    sales/assets/day
    Sales/itemgroup/asset/day
    sales/salesperson/asset/day
    etc.
    My problem is that i have this data on a month&store level, but i need to provide a solution, so it could be handled as a "global" value on that, so they can query it "almost any ways".
    I don't really want to generate day/other level data based on this, so any tricks, how to repeat the data in all lines for that specific month on presentation/Business level?
    All ideas are welcome.
    Thanks&Regards,
    D
    Edited by: user8113564 on 2012.09.11. 4:52

    Sorry if I took this wrong but are you try to do level based measured
    Take the same physical column in the fact and have one aggregated at a month level and the other at a day level.
    If yes, make sure you build a date dimension hierarchy and mapped at the correct level to the fact. Then take your measure and correctly define them at the correct level, day, month etc
    This should sort it out

  • Need ideas on how to deploy to multiple locations

    I could use a few tips. We are deploying ipads in groups of ten to 22 different locations. Each location has their own ideas about which apps to use. I have one macbook air with apple configurator loaded on it. If I use my master generic itunes account, I'll have a ton of apps to sort through and the user will be prompted for credentials for every app update. What would your do, or are doing, for mulitple deployments like this one? How would you set up your macbook? I've thought of a logon for each location on the macbook but then I have to download ios6 each time (can't find the actual ios6 ipsw file to copy to all of the accounts).

    I think some type of centrally managed MDM would be best for the situation you describe.  We are in the process of moving ahead with an AirWatch implementation for use as our MDM.  There are lots of MDM products out there, including one that comes included with Lion Server. I think OTA  management, where you have widely dispersed locations would be more practical.  If you haven't you should also look at the Volume Purchasing program.  Another consideration is whether the connecting devices will be company or personally owned, or a mixture of both.  You could also look at the education deployment guide, even if you aren't in education, it has a lot of great ideas. 
    http://images.apple.com/education/docs/IOS_5_Education_Deployment_Guide.pdf
    http://images.apple.com/business/docs/VPP_Business_Guide_US.pdf

  • Need ideas on how to display a footer on last page only on a dynamic document

    I have a document that is similar to this...
    Dear Customer,
    paragraph 1 content dkdk dkd alkfdjaldkjfa d
    dlkfajd;lkfja;dlkfj a.
    [repeating subform transaction data]
    Closing paragraph please contact us using one of the numbers listed below
    contact info
    The problem I am having is that I want the Contact Info block to appear as a footer on the last page only.  In addition, I want the Closing Paragraph to be on the same page as the contact info block.  The contact info is currently anchored to the bottom in the design view and when the transaction data repeats, it incorrectly pushes the closing paragraph into the contact area.  So basically if the closing paragraph starts to bleed into the contact info block, I want both closing paragraph and contact info to break to a new page.  I don't want to reduce the height of the content area because I want the transaction data to have the ability to display in the full length of the height if needed. 

    Every time you add an instance to you subform, you should hide the footer in the previous instance
    e.g.
    when adding an instance
    var intCount = _subform.count;
    _subform.addInstance(1);
    Reference_syntax.resolveNode("subform[" + intCount.toString() + "].footer").presence = "hidden"
    when removing an instance if applicable
    _subform.removeInstance(x);
    var intCount  = _subform.count - 1;
    Reference_syntax.resolveNode("subform[" + intCount.toString() + "].footer").presence = "visible";

  • Firefox crashed and subsequently wiped out my history - need ideas on how to retrieve history!

    *Mac 10.6.6
    *Firefox preferences always set to "remember history"
    *Before crash and history wipe-out, I had just:
    - been updating to iCal beta from apple.com

    Then your address book cannot be restored. You might be able to reconstruct it to some point, based on your existing e-mail messages.
    There is an [https://addons.mozilla.org/nl/thunderbird/addon/email-address-crawler address crawler add-on] for Thunderbird, but it was not tested with the latest version and might not install. You could try this, however getting this to work with the latest version may need help from the author.
    Maybe you could temporarily install an older version of Thunderbird, as suggested by one of the commenters of the add-on.
    Addons are not supported by Mozilla directly, but the author might be able to help you with it.
    Hope this helps you further, maybe a technical person near you might be able to help you out locally?

  • Need ideas on how to manage upgrade to legacy proc, func ...etc

    We have legacy procedure, function and packages. Ex: JOURNAL_DETAIL(), a journalization procedure.
    All our applications make direct calls to this object (thru DLL sometimes). We implemented a new version of JOURNAL_DETAIL, with the same signature, but the code inside depends on a new package. Bug, some application cannot be updraded to the new package at the same time, so we decide to have two function:
    JOURNAL_DETAIL -- the old ond
    JOURNAL_DETAIL_XXX -- the new one
    But then the other application would have to be changed to use JOURNAL_DETAIL_XXX(), so we decided we dont like this.
    So we decided to provice a unique JOURNAL_DETAIL() which will decide if the old code should be called or the new one, depending is the new package is installed and initialized. But since we dont want to duplicate code in one humongous proc, we decided to provide:
    JOURNAL_DETAIL -- now a dispatcher to
    JOURNAL_DETAILI_LEGACY
    JOURNAL_DETAIL_NEW_APPL
    But eventually we wiil end up having several version of the same function in our schema, winch we are not sure its a good idea. With DLL, the problem is simple, keep the same interface, but change the code in the DLL. We would like to know if there is a way to do this in Oracle.
    Maybe using packages ?
    Thanks.

    What do DLLs have to do with what you are doing in an unstated (3 decimal places) version of Oracle?
    You have provided almost no information that can be used to generate a response beyond just a wild guess.
    Assuming DLL refers to a Windows-only Windows-centric design I would urge you to move your code inside the database into packages.

  • I need ideas on how to organise large amount of family pictures

        My Dad's house had a major fire a month ago. And all the family slides and photo's have smoke damage some badly. And I am afraid the acids in the smoke are going to rapidly ruin the rest.
       I have about 600 slides in projector reels and 2-3 hundred loose from 1966 to about 1977. Plus a few hunderd photo's. Probally half have date tags on the slides but they are all out of order. And some have names and other info written on them I want to be able to save with the pictures. I am thinking I have to attach all the info I can get to the picturs as I scan them. But want to have some kind of logical order when I am done.
       I am thinking of having folders by years to put them in as I scan them and or by location when I know it. But its such a big project I am not sure where to start. Or if that is the best idea.
       So any idea's on the best way to to do it. And keep it organised and as easy as possible would be very helpfull. Both the Adobe Elements 8 software is new to me and so is the canoscan 9000f I got to scan them with.
    Thanks Billy

    While there is no one way to Organize, the basic idea in my opinion, is to associate all information with the photos themselves, using tags, captions and notes. The multiple dimensions you have described almost by definition rule out a uni-dimensional hierarchy like folders. If you must pick a folder method, I guess year taken is as good as any. But the rest of the information should go into multiple hierarchies, and the only way to do that is, as I said, tags, captions and notes in PSE. This information could be written into the files themselves using the PSE organizer command File->Write Tags...
    Tags usually work for categories of information, such as Who, Where, What, When and Event, like a birthday party. Captions and notes are usually for one-of-a-kind information, such as descriptions like "Uncle Bob on the right, Aunt Matilda on the left, with their dog Peaches" (and of course, you would also assign the tags for Uncle Bob and Aunt Matilda).
    Good luck!

  • I am trying to open PDF files from safari, but when I click on them they open in a separate window and the information is encrypted. Any ideas on how to get them to open them in Adobe? Any help please!

    I am trying to open PDF files from safari, but when I click on them they open in a separate window and the information is encrypted. Any ideas on how to get them to open them in Adobe? Any help please!

    The pdf is loading as html code. If you save it, it will download as :
    605124.pdf.html
    Change the extension to .pdf
    And it opens and works perfectly, I just tested it:
    Use this link to download it automatically:
    http://saladeaula.estacio.br/arquivo.asp?dir=00/1020624/605124.pdf&num_seq=59828 4

  • HT4436 Why is my daughter receiving my text messages on her itouch when I send them from my iphone? We are both on icloud so how can I separate the two? Do I need another icould or apple account??

    Why is my daughter receiving my text messages on her itouch when I send them from my iphone? We are both on icloud so how can I separate the two? Do I need another icould or apple account??

    It's happening because you are using the same Apple ID for iMessage.  You don't need to do anything with your iCloud account to fix this.  You should create a separate Apple ID for her device to use with iMessage and FaceTime.  (You can continue to share the same ID for purchasing from the iTunes and App stores if you wish; it doesn't need to be the same as the ID you use for other services.)  Once you've done this, on her device go to Settings>Messages>Send & Receive, tap the ID, sign out, then sign back in with the new ID.  Do the same thing in Settings>FaceTime.
    Another caution is that if you share and iCloud account with her, any data you both sync with the account such as contacts, will be merged and the merged data will appear on both devices.  If you don't want to end up with each other's contacts, calendars, etc. on your devices, you should have separate iCloud accounts to.  If you want to make this change, go to Settings>iCloud on her device and tap Delete Account.  (This only deletes the account from the device, not from iCloud.)  When prompted about what to do with the iCloud data be sure to choose Keep On My iPod.  Then set up a new iCloud account with her new ID, turn on iCloud data syncing again, and when prompted choose Merge.

  • TS4268 I have an iphone on my account & added my daughter's ipod touch 5th generation to it. Now all my iphone info is on her ipod, even my phone number! How do I separate the two? Do I need to reset her ipod?

    I have an iphone 4s on my itunes account & added my daughter's new ipod touch 5th generation. Now everything from my iphone is on her ipod & still on my phone too, even my phone # shows up as her ipod. How do I separate the 2 devices? Do I need to reset her ipod? If so when I plug it into the computer won't it happen again?

    Don't select his apps to sync.
    Your iphone will only sync what you select

  • I bought CS6 creative suite. As of now i need to work each application in separate separate system. Can any one please help me how to solve this problem.

    I bought CS6 creative suite. As of now i need to work each application in separate separate system. Can any one please help me how to solve this problem.
    I saw the below quote on Adobe forum
    "You may install software on up to two computers. These two computers can be Windows, Mac OS, or one each."
    If i install each application in single single system the system count is more than two. In this case, are we have any license issue? Please advice how the problem will solve?
    If possible please send the advise to my mail id: <Removed by Moderator>
    Thanks
    Uvaraj S

    I already answered that.  If you purchased a Suite then you can only install and activate it on two machines.  Even if you only insdtall one of the applications of that suite, it counts as one activation of the suite.  You cannot take the six or seven different applications that might be in a suite and install and activate them in six or seven different machines... only two machines.
    If your scenario will allow for it, one thing you can do is install the programs on all the different machines and only activate two of the machines at any given time.  If you need to activate a program on a third machine then you need to deactivate on one of the currently activate machines first so that you have an open activation to use again.  I do not remember if there is a limit to the total number of activations you can process for the life of the software.

Maybe you are looking for

  • Accessing select result in an SQL query

    I would like to know if anyone has a simple solution to this problem. I have a database with a table in it called events; the table has five fields: event_id, game_type_id, game_venue_id, game_day, and game_time. I would like to build a form that sel

  • ITunes encounters problem

    I try to open iTunes and it says it has encountered an error and needs to close. Also if i try to install quicktime, just to see if tht would help it says a newer version is already in download. Can u help me fix this problem?

  • Adobe Reader will not read pdf files on internet

    I have lastest version of Adobe reader on a new mac running OS 10 Maverick. This has latest safari (7.0.1) as my internet browser. My adobe reader reads pdf files already present on my desktop, but will not read pdf files from the internet even after

  • EDI ALE DOUBTS

    hi , 1) if an idoc is failed , how wil u create it again (not reprocessing bd87). 2)how wil u debug idoc program. 3) how to configure edi and ale. 4) status 51(application not posted) error records will get stored in which table. 5)is it possible to

  • "posix_spawnp("/Library/StartupItems/ProTec6b/Nalpeirond6b", ...): No such file or directory" Since this is not there, how can I get rid of it repeating and repeating?

    Hello Mac users, After recognizing slowness and heat in my machine, I find posix_spawnp("/Library/StartupItems/ProTec6b/Nalpeirond6b", ...): No such file or directory in my system.log, but, looking in the library, well, the file isn't there. I delete