Why controls and labels don't go to their respective places?

i wonder why the controls and labels don't go to their respective setLocations, they just keep stacking theirselves at the top....
don't bother the whole code, it still not yet finish.
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class Fonts2 extends Applet implements ItemListener
Label ds, bc, fset, col, st, sz, xyz, opt, qua, totcha, cas;
CheckboxGroup g1 = new CheckboxGroup();
CheckboxGroup g2 = new CheckboxGroup();
CheckboxGroup g3 = new CheckboxGroup();
CheckboxGroup g4 = new CheckboxGroup();
Checkbox blue,red,green, pink, yellow, magenta, style1, style2, style3, size1, size2, size3;
Font plain, bold, italic, a1;
String fs="Arial";
public void init(){
ds = new Label("Display Settings");
bc = new Label("Background Color");
fset = new Label("Font settings");
col = new Label("Color");
st = new Label("Style");
sz = new Label("Size");
plain = new Font(fs,Font.PLAIN,12);
bold = new Font(fs,Font.BOLD,12);
italic = new Font(fs,Font.ITALIC,12);
blue = new Checkbox("blue",false, g3);
red = new Checkbox("red", false, g3);
green = new Checkbox("green", false, g3);
pink = new Checkbox("pink",false, g4);
yellow = new Checkbox("yellow",false, g4);
magenta = new Checkbox("magenta",false, g4);
style1 = new Checkbox("plain", false, g1);
style2 = new Checkbox("bold", false, g1);
style3 = new Checkbox("italic", false, g1);
size1 = new Checkbox("14", false, g2);
size2 = new Checkbox("16", false, g2);
size3 = new Checkbox("18", false, g2);
ds.setLocation(10,10); ds.setSize(100,20);
bc.setLocation(20,30); bc.setSize(120,20);
blue.setLocation(150,30); blue.setSize(50,20);
red.setLocation(210,30); red.setSize(50,20);
green.setLocation(270,30); green.setSize(50,20);
fset.setLocation(20,50); fset.setSize(120,20);
col.setLocation(80,70); col.setSize(50,20);
st.setLocation(180,70); st.setSize(50,20);
sz.setLocation(280,70); sz.setSize(50,20);
pink.setLocation(75,90); pink.setSize(50,20);
yellow.setLocation(75,110); yellow.setSize(50,20);
magenta.setLocation(75,130); magenta.setSize(50,20);
  style1.setLocation(175,90); style1.setSize(50,20);
  style2.setLocation(175,110); style2.setSize(50,20);
  style3.setLocation(175,130); style3.setSize(50,20);
  size1.setLocation(275,90); size1.setSize(50,20);
  size2.setLocation(275,110); size2.setSize(50,20);
  size3.setLocation(275,130); size3.setSize(50,20);
add(ds); add(bc); add(fset); add(col); add(st); add(sz);
add(blue); add(red); add(green);
add(pink); add(yellow); add(magenta);
add(style1); add(style2); add(style3);
add(size1); add(size2); add(size3);
blue.addItemListener(this);
red.addItemListener(this);
green.addItemListener(this);
pink.addItemListener(this);
yellow.addItemListener(this);
magenta.addItemListener(this);
style1.addItemListener(this);
style2.addItemListener(this);
style3.addItemListener(this);
size1.addItemListener(this);
size2.addItemListener(this);
size3.addItemListener(this);
public void itemStateChanged(ItemEvent e){
if(blue.getState()==true){setBackground(Color.blue); repaint();}
if(red.getState()==true){setBackground(Color.red); repaint();}
if(green.getState()==true){setBackground(Color.green); repaint();}
if(pink.getState()==true){style1.setForeground(Color.pink); repaint();}
if(yellow.getState()==true){style1.setForeground(Color.yellow); repaint();}
if(magenta.getState()==true){style1.setForeground(Color.magenta); repaint();}
if(style1.getState()==true){style1.setFont(plain);}
if(style2.getState()==true){style1.setFont(bold);}
if(style3.getState()==true){style1.setFont(italic);}
if((style1.getState()==true)&&(size1.getState()==true)){a1 = new Font("Arial", Font.PLAIN, 14); style1.setFont(a1);}
if((style1.getState()==true)&&(size2.getState()==true)){a1 = new Font("Arial", Font.PLAIN, 16); style1.setFont(a1);}
if((style1.getState()==true)&&(size3.getState()==true)){a1 = new Font("Arial", Font.PLAIN, 18); style1.setFont(a1);}
if((style2.getState()==true)&&(size1.getState()==true)){a1 = new Font("Arial", Font.BOLD, 14); style1.setFont(a1);}
if((style2.getState()==true)&&(size2.getState()==true)){a1 = new Font("Arial", Font.BOLD, 16); style1.setFont(a1);}
if((style2.getState()==true)&&(size3.getState()==true)){a1 = new Font("Arial", Font.BOLD, 18); style1.setFont(a1);}
if((style3.getState()==true)&&(size1.getState()==true)){a1 = new Font("Arial", Font.ITALIC, 14); style1.setFont(a1);}
if((style3.getState()==true)&&(size2.getState()==true)){a1 = new Font("Arial", Font.ITALIC, 16); style1.setFont(a1);}
if((style3.getState()==true)&&(size3.getState()==true)){a1 = new Font("Arial", Font.ITALIC, 18); style1.setFont(a1);}
}

just add :
setLayout(null);at the start of init() method.
Thanks!

Similar Messages

  • HT1211 I have songs in Itunes that at one time synced to my ipod. Now some do and some don't even if their box is checked

    I have songs in Itunes that at one time synced to my ipod. Now some do and some don't even if their box is checked. I also have the latest Itunes software.
    I can still play them in Itunes but some won't sync to Ipod and I don't know why.

    Hey pooleking,
    I'd start the troubleshooting with your iPod. You can find some basic steps to start with here:
    iPod troubleshooting basics and service FAQ
    http://support.apple.com/kb/TS1382
    Take care,
    David

  • Fusion Middleware control and targets don't work

    Hello,
    I got problems with the Fusion Middleware control and targets that don't work after upgrading from AS 10.1.2.3 to 11g.
    I have WLS 11g running. The WL Admin consoles are working (http://<hostname>:7001/console and http://<hostname>:7002/console)
    1. Fusion Middleware control on Infra (http://<hostname>:7001/em) does not return anything - just show <loading> on the screen.
    2. Fusion Middleware control on Mid Tier (http://<hostname>:7002/em) returns a 404 error and I found a solution on this forum to do the Extend Domain and turn on/configure Enterprise Manage. I tried and got error "INST-07303 - Specified Domain cannot be used for Extend Domain configuration".
    3. There sre no Targets in both Infra and Mid Tier targets.xml files after ugrading from AS 10.1.2.3 to 11g. How do I transfer all targets from the old AS 10.1.2.3 Infra and Mid Tier targets.xml to Fusion 11g Infra and Mid Tier targets.xml.
    OS is Linux SUSE SLES-10 SP3
    Any help?.
    Thanks,

    create the sh file and comping for forms but this file in a where the forms available
    export ORACLE_HOME=/home/oracle/Oracle/Middleware/as_1
    for i in `ls *.pll`
    do
    echo Compiling Form $i ....
    /home/oracle/Oracle/Middleware/asinst_1/bin/frmcmp.sh userid=aaa/aaa@gggg batch=yes module=$i module_type=LIBRARY compile_all=yes window_state=minimize
    done
    with regards
    Abdulwajid khan
    [email protected]

  • TS3474 I purchaed the earpods with mic & controls and they don't work with 6th generation nano.  Are the features supposed to be compatible with this model of nano?

    I purchased the earpods with mic & controls and the features don't work with 6th generation nano--is this normal?

    Hi there,
    According to the product page:
    The remote and mic are supported by all models of iPod, iPhone, and iPad (not all models support volume up/down functions). Audio is supported by all iPod models.
    Your iPod Nano may be one of the models that does not support the volume up/down function. Take a look at the page below for more information.
    Apple EarPods with Remote and Mic
    http://store.apple.com/us/product/MD827LL/A/apple-earpods-with-remote-and-mic
    -Griff

  • Why Flash and videos don't work after 10.6.7 update?

    After os update Flash, Shockwave and videos stopped working on Safari. Also Flash CS5, Flash Builder 4 and Flash Catalyst CS5 stopped working. An error message on Flash CS5 "Error initializing Java Runtime Environment. You may need to reinstall Flash." I have uninstalled and reinstalled stuff, fixed the HDD errors etc but so far no solution. Is this simply error in update software made by some tired engineer?

    2 Suggestions:
    1) Try reinstalling Mac OS X 10.6.7 via Combo Update, it's a common troubleshooting step:
    http://support.apple.com/kb/DL1361
    2) Have you installed the latest Mac OS X Java Update 4?
    http://support.apple.com/kb/DL1360
    I would also suggest to check Adobe's Support Page to see if other users are experiencing the same:
    www.adobe.com/support
    Good Luck!

  • Why Safari and QuickTime don't work on OS 10.3.9?

    I have an old Mac G4 running OS 10.3.9.  Safari 1.3.2 does not work properly. Moreover QuickTime does not work at all. I cannot watch the movies on my website. I know my site is OK because everything works with a newer computer. What can I do to improve the situation? The interesting thing is that in the past everything worked fine. The problems started when I reinstalled the system and upgraded it to 10.3.9. Any help will be greatly appreciated. I also apologize for having posted the same question on the Safari forum. But I think the present forum is more appropriate.

    When you reinstalled and upgraded to 10.3.9 you perhaps have not applied relevant updates to Java and Flash.
    10.3 Panther barely works on the internet anymore so i am not suprised you are having problems.
    You can check which Java version you have at the link below
    http://www.javatester.org/version.html
    and I'd try another internet browser like Camino. It is 'less old' than Safari is on 10.3, but basically 10.3 has been left behind as far as the internet goes.

  • Why Safari and QuickTime don't work with OS 10.3.9

    I have an old Mac G4 running OS 10.3.9.  Safari 1.3.2 does not work properly. Moreover QuickTime does not work at all. I cannot watch the movies on my website. I know my site is OK because everything works with a newer computer. What can I do to improve the situation? Any help will be greatly appreciated.

    Click Software Update from your Apple menu. Make sure your software is up to date.
    Moreover QuickTime does not work at all. I cannot watch the movies on my website. I know my site is OK because everything works with a newer computer.
    The older Safari / QT versions may not be able to stream the video.

  • Is there an application that can batch convert wma to m4a and save the output files to their respective original file location?

    I need to convert thousands (yes, really) of wma files to m4a.  The wma files are all located in different folders and each converted m4a file needs to end up in the same folder as its respective original wma file.  Does anyone know of an application that can do this?
    Thanks,
    Will

    I'm not completely sure that MPEG Streamclip can convert AVCHD footage (.mts files).  If MPEG Streamclip doesn't do the job, then get a copy of Clipwrap, which was designed for transcoding .mts files to QuickTime/Apple Intermediate Codec (that's the format/codec you need to convert the .mts files to for use in FCE).

  • How do I get my controls and indicators to clear after each run of the VI?

    I am using LabVIEW for my Senior Design Project in EET for Purdue University-Indianapolis. After each run of my VI, I want the controls and indicators to go back to their default state (cleared). I don't see an option for this. For example, I have a password VI that allows a user to log in. Once this sub-VI is rerun, the password from the previous user is still there. How do I clear this??? after each run???
    Thanks, D

    Use the property node and invoke node to clear.
    In your block diagram,
    Function Platte.
    >Application Control
    >>Invoke Node
    Then right click the invoke node..
    >From "select VI server class" option
    >>choose "VI"
    Then right click again
    >From "method" option
    >>choose reinitialize all to default
    That will reinitialize all your value to default
    if you want to reinitialize only your password to default then its simple
    right click the invokenode agian
    >From "link to" option
    >>Then link your invoke node to any control or indicators
    I attach one simple file for you
    Hope that will work..
    Saw
    Naing Aye(Maymaythar)
    Attachments:
    reinitialize.vi ‏14 KB

  • Why am I being told that a JPEG file that I made changes to in Photoshop 6 (CS6) can't be saved?  The message I get says that either the file is locked and I don't have permission to execute this or another program is using this file.

    i recently purchased a 21.5 iMac with Yosemite (10.10.1) and was disappointed to discover that my CS6 programs are not functioning correctly.  I am unable to use the "Save As" command  when making changes to a JPEG file in Photoshop.  The message I get says that either another program is using the file or it is locked and I don't have permission to execute that command.  I'm experiencing a similar problem in Bridge when trying to move an unwanted file to the Trash.  Again, I get a message telling me that i don't have permission to do this.  Lastly, I'm unable to open any Camera Raw files.  Any suggestions?  I had no problems with the Mavericks OS on my old iMac and although it's much slower, I'm tempted to go back to using my old iMac.  At this point, I feel as if I've just wasted $2300+ (tax included). 

    Back up all data before proceeding.
    This procedure will unlock all your user files (not system files) and reset their ownership, permissions, and access controls to the default. If you've intentionally set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it, but you do need to follow the instructions below.
    Step 1
    If you have more than one user, and the one in question is not an administrator, then go to Step 2.
    Triple-click anywhere in the following line on this page to select it:
    sudo find ~ $TMPDIR.. -exec chflags -h nouchg,nouappnd,noschg,nosappnd {} + -exec chown -h $UID {} + -exec chmod +rw {} + -exec chmod -h -N {} + -type d -exec chmod -h +x {} + 2>&-
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad and start typing the name.
    Paste into the Terminal window by pressing command-V. I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.
    You'll be prompted for your login password, which won't be displayed when you type it. Type carefully and then press return. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command may take several minutes to run, depending on how many files you have. Wait for a new line ending in a dollar sign ($) to appear, then quit Terminal.
    Step 2 (optional)
    Take this step only if you have trouble with Step 1, if you prefer not to take it, or if it doesn't solve the problem.
    Start up in Recovery mode. When the OS X Utilities screen appears, select
              Utilities ▹ Terminal
    from the menu bar. A Terminal window will open. In that window, type this:
    resetp
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password window will open. You’re not going to reset a password.
    Select your startup volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
               ▹ Restart
    from the menu bar.

  • I can't begin to describe this, firefox opens to websites and I don't know why

    PLEASE HELP I never had issues with this browser which I use almost exclusively. Now over the past week, I am having nothing but.
    I have windows 7 pro 64 bit. Once again, I uninstalled and reinstalled firefox after it seemed to be going haywire. I set how I want it to look, and I want the toolbar to show, the "file, edit etc." and I usually don't have problems finding how to do that.
    But yesterday those vanished, and I use them too much and I don't know what happened.
    So after I uninstalled and re-stalled, that took care of it.
    HOWEVER now this browser when I open it, I open a new tab, which should bring a blank page, it goes to the last site I was. I did not set it to do that.
    1) Does anyone know how to stop that?
    2) It does open to the home page IF I click on firefox, but a new tab should bring just that.
    Why is this happening? That is my second question. Can anyone remotely be tampering with this?
    How would that happen, if so, and how to I guard against it?
    I DO NOT let this save passwords. I don't let any browser do that.
    Last, my email on my phone worked just fine until Friday morning, the last time it synched.
    Now I can't get emails on my phone because it says "password changed" -- what the f****? I didn't change anything, I am getting my emails on my notebook just fine, I have a pin on my phone so I can't fathom what is happening. This NEVER happened with my windows phone. I put in the password, and that was that. No issues.
    That strays from Firefox, but it is an overall cause of problems of changes etc. that are making me very concerned. Yes I have macafee security.
    LAST if someone had remote access, such as a tech with a company, and you end the access can the remote access ON THEIR END be re-connected?
    THANK YOU SO MUCH in advance for help with firefox issue, and any insight on the others.
    Gina

    Hey Gina,
    Change all your passwords, this will stop the remote access if there are any. Also check to make sure there are no third party apps managing your passwords. Also please contact the tech support for the phone for more technical help on that issue :-)
    I also understand that the customization is not staying. [[Customize Firefox controls, buttons and toolbars]]
    Did this happen when you synced last? Also are there more than one device with different Customized ui settings?
    Change the settings back from open "pages from last time" to the other homepage: [[How to set the home page]] or if this happened after you attached another device to the sync account, uncheck Preferences from the sync settings.

  • How can I make a global change so all controls and indicators labels on the front panel change to another colour?

    How can I make a global change so all controls and indicators labels on the front panel change to another colour?
    I need to change the front panel so that it can be used in a dark environment.

    Hi
    The only way I see, is to use the "Controls[]" property and iterate through all of them. But don't forget about nested elements (i.e. clusters, tab-controls, ...).
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...

  • Why does my Imac screen slide and I lose my screen?  It goes back to my desktop.  Then sometimes my screen goes to full screen and I don't know how to get out of it.

    Why does my Imac screen slide and I lose my screen ~ It goes back to my desktop.
    Then sometimes my screen goes to full screen without me doing any commands, and I don't know how to get out of it without going to force quit and starting all over. 

    Hi,
    When it goes full screen try moving the mouse up to top right of scren & see if there a double diagonal Arrow to click on.
    On the other see if it's the silly implentation of Spaces/Mission Control/Expose in ML...
    https://discussions.apple.com/thread/4298411?start=0&tstart=0

  • When i try to send email from my ipad i get the message The recipient "£)()&&£)" was rejected by the server. This has only just started to happen and I don't know why. Please help. I have tried lots of things now and cannot solve it.

    When i try to send email from my ipad i get the message The recipient "£)()&amp;&amp;£)" was rejected by the server. This has only just started to happen and I don't know why. Please can someone help. I have tried lots of things now and cannot solve it.

    "Your email account" means to tap on the name of your email account. Whatever it is listed as in the settings.
    In my mail settings, one of my email accounts is a Comcast account. I tap on the Comcast name and it brings up this window.
    Then I tap on the arrow under the Outgoing mail server smtp setting to get to the next window.
    In the resulting window, I then tap on the arrow next to the smtp server under the Primary Server setting.
    That brings up this window in which I check to make sure that my user name and password have been entered correctly. If those items are missing, enter them in the appropriate fields and then tap done.

  • Which Mac Pro? More cores=slower speeds? And most of us know the speed matters or FPU for music and I don't understand the faster is for the least amount of procs. And while I get the whole rendering thing and why it makes sense.

    Which Mac Pro? More cores=slower speeds? And most of us know the speed matters or FPU for music and I don't understand the faster is for the least amount of procs. And while I get the whole rendering thing and why it makes sense.
    The above is what the bar says. It's been a while and wondered, maybe Apple changed the format for forums. Then got this nice big blank canvas to air my concerns. Went to school for Computer Science, BSEE, even worked at Analog Devices in Newton Massachusetts, where they make something for apple. 
    The bottom line is fast CPU = more FPU = more headroom and still can't figure out why the more cores= the slower it gets unless it's to get us in to a 6 core then come out with faster cores down the road or a newer Mac that uses the GPU. Also. Few. I'm the guy who said a few years ago Mac has an FCP that looks like iMovie on Steroids. Having said that I called the campus one day to ask them something and while I used to work for Apple, I think she thought I still did as she asked me, "HOW ARE THE 32 CORES/1DYE COMING ALONG? Not wanting to embarrass her I said fine, fine and then hung up.  Makes the most sense as I never quite got the 2,6,12 cores when for years everything from memory to CPU's have been, in sets of 2 to the 2nd power.  2,4,8,16,32,64,120,256,512, 1024, 2048,4196,8192, 72,768.  Wow. W-O-W and will be using whatever I get with Apollo Quad. 
    Peace to all and hope someone can point us in THE RIGHT DIRECTION.  THANK YOU

    Thanks for your reply via email/msg. He wrote:
    If you are interested in the actual design data for the Xeon processor, go to the Intel site and the actual CPU part numbers are:
    Xeon 4 core - E5.1620v2
    Xeon 6 core - E5.1650v2
    Xeon 8 core - E5.1680v2
    Xeon 12 core - E5.2697v2
    I read that the CPU is easy to swap out but am sure something goes wrong at a certain point - even if solderedon they make material to absorb the solder, making your work area VERY clean.
    My Question now is this, get an 8 core, then replace with 2 3.7 QUAD CHIPS, what would happen?
    I also noticed that the 8 core Mac Pro is 3.0 when in fact they do have a 3.4 8 core chip, so 2 =16? Or if correct, wouldn't you be able to replace a QUAD CHIP WITH THAT?  I;M SURE THEY ARE UO TO SOMETHING AS 1) WE HAVE SEEN NO AUDIO FPU OR PERHAPS I SHOULD CHECK OUT PC MAKERS WINDOWS machines for Sisoft Sandra "B-E-N-C-H-M-A-R-K-S" -
    SOMETHINGS UP AND AM SURE WE'LL ALL BE PLEASED, AS the mac pro      was announced Last year, barely made the December mark, then pushed to January, then February and now April.
    Would rather wait and have it done correct than released to early only to have it benchmarked in audio and found to be slower in a few areas- - - the logical part of my brain is wondering what else I would have to swap out as I am sure it would run, and fine for a while, then, poof....
    PEACE===AM SURE APPLE WILL BLOW US AWAY - they have to figure out how to increase the power for 150 watts or make the GPU work which in regard to FPU, I thought was NVIDIA?

Maybe you are looking for