Second Layout..

free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > Java, Java Servlets, Java Script, & JSP

Second Layout..

kvarnerexpress
I am using a frame a triple times, I mean, i want to use the same JFrame to display 3 different setup's of components in a sequencial way. First i as for to select drives, second i display a progressreport, last, user select a certificatedirectory. I am using getContentPane().removeAll() and then i add the new components but this doesn't show. The frame reamins blank after the first removeAll(). Is there some trick.??? Code follows...



CODE

class ScanForCertificateStore extends JFrame {
 FindCertificates fc;
 ScanForCertificateStore sfcs=this;

 DefaultListModel lmRoot = new DefaultListModel();
 JList lbRoot = new JList(lmRoot);
 JScrollPane spRoot = new JScrollPane(lbRoot);
 JButton bStartScan = new JButton("Start Scan of Selected ");

 File[] Roots;

 public ScanForCertificateStore (FindCertificates fc) {
   this.fc = fc;

   final Container p = getContentPane();

   setSize(200,200);
   setLocation(100,100);

   p.setLayout(new BorderLayout());

   p.add(spRoot,BorderLayout.CENTER);
   File f = new File("\\");
   Roots = f.listRoots();
   for(int i=0;i<Roots.length;i++){
     lmRoot.addElement(Roots[i].getAbsolutePath());
   }

   p.add(bStartScan,BorderLayout.SOUTH);
   bStartScan.addActionListener(new ActionListener() {
     public void actionPerformed(ActionEvent e) {
       // dfeine new layout
       JPanel aPanel = new JPanel(new BorderLayout()),
           bPanel = new JPanel(new BorderLayout());
       final DefaultListModel lmFound = new DefaultListModel();
       JList lbFound = new JList(lmFound);
       JButton bAbort = new JButton("Abort Scanning Computer"),
           bSelect = new JButton("Select a Certificate Store");
       final JTextArea taReport = new JTextArea("");
       JScrollPane spFound = new JScrollPane(lbFound),
           spReport = new JScrollPane(taReport);

       aPanel.add(spReport,BorderLayout.CENTER);
       aPanel.add(bAbort,BorderLayout.SOUTH);

       bPanel.add(spFound,BorderLayout.CENTER);
       bPanel.add(bSelect,BorderLayout.SOUTH);
       
       p.removeAll();   // fisrt removeAll() (second isn't there jet..
       p.add(aPanel,BorderLayout.NORTH); // These componets don't show up on tyhe frame...
       p.add(bPanel,BorderLayout.SOUTH); //

       ArrayList a = new ArrayList();
       for(int i=0;i<lmRoot.size();i++) {
         if(lbRoot.getSelectionModel().isSelectedIndex(i)) {
           a.add(Roots[i]);
         }
       }
       Object[] o = a.toArray();
       //File[] ff= (File[]) a.toArray();
       ScanComputer sc = new ScanComputer(o, sfcs.fc.tfStore.getText());
       sc.addReporter(new Report() {
         public void action(String msg) {
           taReport.append(msg);
           taReport.setCaretPosition(taReport.getText().length());
           repaint();
         }
       });
       sc.addStore(new Report () {
         public void action(String msg) {
           lmFound.addElement(msg);
           repaint();
         }
       });
       sc.addFinish(new Report() {
         public void action (String msg) {
           
         }
       });
       sc.start();
     }
   });
 }
}

 

 

 


Reply

beeseven
I had a problem like that recently. I'm not sure if it's the exact same thing, but try adding this line after you add all the components:
CODE
p.updateUI();

Basically it tells the frame that something has changed, and to display the change, so the stuff should show up.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Similar Topics

Keywords : layout

  1. Trap17 Flex Layout
    (0)
  2. Website/blog Layout (circle Design)
    (2)
    Opinions? Took me a while, don't look at the design in the middle the abstract that is there
    just because i needed to put something there for a example. Judge the website layout it self. And
    if anyone wants to purchase this i'm open to offers.....
  3. Website Layout?
    Help me please (3)
    Im sorta really new to html and php, and i want to make or edit a layout for my website that i might
    get from this forum thing, and i need sombody to point me to some tutorials or make me a layout.
    also if you want to you can make me a myspace one too xD. Please and thanks.....
  4. Mine And Kansuke's Website Layout
    (5)
    Me and KansukeKojima are making a graphics website and I have made a layout in GIMP that I would
    like a rating for. Here is a picture of what it should look like. ....
  5. Css Layout Help
    need help with my layout (8)
    http://billy61.trap17.com/divs/modulemaker.php i am rewriting my layout in divs instead of
    tables. the problem i have, is i need the divs with the "L" and "R" in them to extend all the way
    down to the bottom of the "content" div. also, what do i need to do to center the entire thing on
    the webpage? and it appears as though the top center div extends down into the middle div by
    like... maybe 5 px... is this just an illusion or is it really happening? this is the source html
    for the page: CODE <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional....
  6. What Do You Think About My Layout-image?
    (2)
    Hello. So I made this layout image, and I would like to hear what you think about it. I did not
    spend to much time, but some. Most of the time was used to find images, and apply a vintage effect.
    I think it came out okey, but that is my opinion. I am not to good with photoshop, and you can say
    that it looks a bit "piczo-ish". Haha, new word. /tongue.gif" style="vertical-align:middle"
    emoid=":P" border="0" alt="tongue.gif" /> Anyway, I can say that the "theme" is a bit related to
    poverty, and such things. I am not quite happy about the blending some places. It is quite....
  7. Nice Clean Php Layout Coding.
    Learn a nice neat way to code your layouts with php (7)
    There are basically two main ways to code your php. Method 1) Creating a php document with an html
    look. The you throw in include tags all over the place. Its unorganized, and you have lots of stray
    files hidden in folders and scattered in your base directory. Its difficult to organize, and you
    make mistakes easily. Example: This document would be called index.php Whatever
    Banner or something Some content here. Mostly along the lines of You might ask what
    the problem was? Well, those include tags tend to multiply, and so do all those unne....
  8. Centered Div Layout Issues
    Float Right item not vertically aligned with text (2)
    Hey everyone. I am writing an all div layout for my friends website and i just cant seem to get all
    the fields aligned properly. I can get all my images to be aligned and look great until i put any
    text on the site. For example, my box that will contain links and such has 3 parts: top, middle and
    bottom. Each of these have 3 parts: left, middle and right. To program the 3 parts of each row, i
    use 3 divs which are all floated based on their position. However, as soon as I put text in the
    middle area, the right image is moved down to a new line. The sample site is located ....
  9. I Need Myspace Layout Ideas =/
    (0)
    hello there fellow trap17 members. As some of you know I use my webspace to distribute stuff for
    myspace and other things... but i'm running out of ideas Here are the layouts i currently
    have: Paramore Make Cupcakes not war Rainbows The spaces between your fingers (AKA the kissy kissy
    layout) You were born original. Don't die a copy. Playin like a playa I also need some ideas
    for more guysh layouts... I'm chalenged in that department /tongue.gif"
    style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /> Please help me out
    /biggrin.gif" s....
  10. Please Review My Layout
    In a JPEG mockup (7)
    I am designing a layout for my blog. Can you please give me your comments? I don't want to do
    up my entire website before realizing that there are improvements to be made. So I would appreciate
    it if you can give me some feedback. When you first look at the website, you may find it weird
    because I try to be different from all the blogs you see out there. The JPEG mockup is attached.
    Hope to hear some constructive criticism or praise /smile.gif" style="vertical-align:middle"
    emoid=":)" border="0" alt="smile.gif" />....
  11. New All Black Myspace Layout
    I find it pretty sweet. (11)
    A ton of you saw my last all white myspace and i got some feedback and way over then 3/4 was
    postive. I wanted to try to get even better feedback with my new all black layout with it's
    Oscar G logo. http://myspace.com/bumwrecker ALL feedback welcome!....
  12. Having A Fixed Layout.
    (8)
    I know how to make HTML/CSS Layouts, but I was wondering if someone could tell me how to have it
    fixed. An example of what I'm looking for is on www.elitemafia.net when you have logged in.
    Any help greatly recieved.....
  13. Need Help With Layout
    (3)
    Hey, I want my website to be in tables (i think it is), but I can't get them near each other
    properly. It gets always messed up, like being bigger than in dreamweaver I want it to be like on
    this site: http://www.maffia-town.nl/ i know it is done with style sheets, but i don't know
    not how exactly....
  14. Why Tables For Layout Is Stupid
    problems defined, solutions offered (10)
    this covers what every web developer/designer should know, first and foremost. /biggrin.gif"
    style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> although this resource has
    been around since 2003, there are still some things to learn from it, especially for beginners. the
    gist of it all is this: avoid TABLES for LAYOUT at all cost. /tongue.gif"
    style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /> Why tables for layout
    is stupid: problems defined, solutions offered MAIN SECTIONS COVERED: Introduction
    QUOTE ....
  15. Easy Layout
    (4)
    well after a few hours serving for inspiration i came across a templete, wich was flashed out and
    stuff, and i liked it so much that i tryed my own version of it,because of the fact i'm best in
    making templates, i tried to make it almost the same,obviously that didn't work so i thought
    wel,PIEP it i'll just go on and see what comes out, wel here is my result without any content
    ofcourse, ....
  16. Help With Css/html Layout
    Horizontal List Problems (5)
    I can't figure out why this horizontal list isnt working. Underneath my banner is supposed to
    be a green gradient bar with a list of links in the center of the page. The links are all the way
    to the left and are really small. The banner is also overlapping the list for some reason. This is
    my current layout(don't worry, I'm not trying to advertise).
    http://www.stormgaming.net/stormcreations/ This is my CSS file
    http://www.stormgaming.net/stormcreations/storm.css Thanks in advance for any help.....
  17. Revamped My Site Layout, Review It?
    Http://isart.co.nr (25)
    I was getting tired with my old one so I decided to redo the layouts. Most of the information is
    still the same but I like the new look. Just a note: The comments section does not have any php
    coding behind it yet, still working on that. Any comments or suggestions would greatly help me!
    Thanks! * If anyone misses the link in the title here it is http://isart.co.nr *....
  18. Lists, Unordered And Nested
    some layout tricks (2)
    Unordered lists are one of the three list types in (x)html. The others are Ordered Lists and
    Definiton Lists. The w3c page of information about lists is here They all behave the same as
    (x)html elements, but there are some differences between them. Read the Specification page linked
    above to know more that you need to know about them. Only difference between html4 and xhtml is the
    tags must be lower-case and closed for xhtml to be valid. Ordered Lists have numbers preceding
    them. Paste the following code into a file and display it in your Browser to see the eff....
  19. [~repost] Anime Layout Request [repost~]
    A request for a layout based on the anime "Bleach". (1)
    .........................................................
  20. Anime Layout Request
    A request for a layout based on the anime "Bleach". (2)
    Hey there! So, I was planning on putting my advanced knowledge of PHP, MySQL, SQL, (X)HTML,
    CSS and JavaScript to use by creating something I've always wanted to create; an online RPG. For
    those of you who don't know what that is, it's a basically just a game created by using the
    coding languages I mentioned before. Like Pokemon Crater.com for example. Anyway, I know what
    I'm doing, how long it's gonna take and the time and commitment I'm gonna need to carry
    this out. However there's one thing I'm stuck on, layout. I've always b....
  21. Web Template Design (request)
    Background Image Layout (1)
    Is anybody out there generous enough to help me out on this? Text: Astral Sub Text: Home/Street
    Records Font: something really cool Anim: would be sweet, but not a must Flash: would be sweet not a
    must Not picky just need something diff from everybody else there using their templates. I sell
    my music on a hosted site and the templates they let you choose from don't suit my taste or gen
    of music. I'm a hip hop artist so i was thinking maybe something like a hanging condenser
    microphone inside a booth as an idea or theme. If you need my username:pw to log in ....
  22. Please Review My New Site Design / Layout / Test In Opera
    Much Appreciated! (17)
    Hi, I just finished setting up a new design for my site and got it successfully validated too
    /biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> yippee!
    Anyway I used css, along with a couple of embedded css lines for my pages (mainly in order to get
    them to validate! - darn background tag is not allowed! /sad.gif"
    style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> ) I'd appreciate it if you
    guys could tell me what you think of the design / text and link colour scheme, and anything else you
    reckon I....
  23. Unusual Request! Check This Out!
    guitar effect layout (12)
    Hello! I bet you have never had this request. Well basically, i need someone to suggest me a
    layout for my DIY guitar effect! Suggested layout will probably end up on my guitar pedal.
    theme: relate this to rock n roll(can you get inspirited by this site?
    www.bulletformyvalentine1.com) background color: preferably black text/art color: you choose image
    size: width=8 cm height=8 cm this is it! thanks guys!....
  24. Need Layout Assistance: Content Area Is Not In Middle [resolved]
    I desperately need help with my css site (14)
    Hi guys & girls, i have a big problem, because I am making a site for this congress and here is
    what is happening to my site using CSS. When I check it on my wamp local server, everything looks
    great, but when I put it on the internet here on trap, things just don't work anymore...
    Please click to visit my problematic site How can I make this "WELCOME... " div in the middle and
    the sidebar with news to the right.. Pleeeeease help soon.. Thanks in advance....
  25. Ie And Firefox Layout Differences
    (11)
    I have had a go at making a website using CSS to dictate the layout (no tables used) and it works
    quite nicely in firefox but when i open it in IE it completely mangles the whole layout. Can
    someone tell me some techniques to prevent this and maybe point me to some helpful pages. Thanks.....
  26. Layout Size
    (10)
    anybody know what the size of a layout is so it fills the whole window.. is it 1024 x 800 or w/e it
    is? i've tried it before but when i publish it, you usualy have to scroll horizontally and i
    dont want that.. i want it to fit perfectly on the window.. (mke my sites on photoshop)....
  27. Futuristic Web Layout
    C&C approved... (11)
    how do you like it ? http://img354.imageshack.us/img354/8766/layout4at.jpg ....
  28. Css And Javascript Combined For Dynamic Layout
    use of different CSS files at same site (9)
    This tutorial is meant for people that are dealing with problems while coding their site at 100% of
    width. Important notice: Some people has JavaScript disabled, so they will not be able to load CSS
    file (take this in account when creating your website). How this script works. In the HEAD of your
    HTML document will apply this command, so variable.js file will be load at start: CODE
    <script type="text/javascript" src="variable.js"></script> In
    browser JavaScript file variable.js is loaded. This Javascript file consist of this para....
  29. Css Layout Generator - *free*
    Generate a CSS layout for your site (5)
    pretty powerful css layout generator. /smile.gif' border='0' style='vertical-align:middle'
    alt='smile.gif' /> and it's freely available online.
    http://www.csscreator.com/version2/pagelayout.php QUOTE To create your layout select the
    structural elements your site requires (header, footer, columns). Then specify a size in the field
    provided and choose a background color from the color chooser below. The color chooser changes
    values as you move your mouse along a row. To set a value click on the color row to release click
    again. Once the color in the box is th....
  30. Site Layout For My Friend
    (9)
    There's something wrong with this layout and I don't quite know what else to add to make it
    look more together. Is anyone willing to add stuff to this layout? I'm kinda going in circles
    with this one. You can go crazy and add your own designs just as long as it would look clean.
    /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /> This is for those with
    spare time only. I'm not trying to pass my dilemma to anyone. /smile.gif' border='0'
    style='vertical-align:middle' alt='smile.gif' /> ....

    1. Looking for layout

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for layout

*MORE FROM TRAP17.COM*
Similar
Trap17 Flex Layout
Website/blog Layout (circle Design)
Website Layout? - Help me please
Mine And Kansuke's Website Layout
Css Layout Help - need help with my layout
What Do You Think About My Layout-image?
Nice Clean Php Layout Coding. - Learn a nice neat way to code your layouts with php
Centered Div Layout Issues - Float Right item not vertically aligned with text
I Need Myspace Layout Ideas =/
Please Review My Layout - In a JPEG mockup
New All Black Myspace Layout - I find it pretty sweet.
Having A Fixed Layout.
Need Help With Layout
Why Tables For Layout Is Stupid - problems defined, solutions offered
Easy Layout
Help With Css/html Layout - Horizontal List Problems
Revamped My Site Layout, Review It? - Http://isart.co.nr
Lists, Unordered And Nested - some layout tricks
[~repost] Anime Layout Request [repost~] - A request for a layout based on the anime "Bleach".
Anime Layout Request - A request for a layout based on the anime "Bleach".
Web Template Design (request) - Background Image Layout
Please Review My New Site Design / Layout / Test In Opera - Much Appreciated!
Unusual Request! Check This Out! - guitar effect layout
Need Layout Assistance: Content Area Is Not In Middle [resolved] - I desperately need help with my css site
Ie And Firefox Layout Differences
Layout Size
Futuristic Web Layout - C&C approved...
Css And Javascript Combined For Dynamic Layout - use of different CSS files at same site
Css Layout Generator - *free* - Generate a CSS layout for your site
Site Layout For My Friend
advertisement



Second Layout..



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE