Alignment in rectangle

Hi
apoligies if this is a repeat, seem to be having serious issues with my PC
If I in cs4 I draw a box using the rectangle tool and the  using the text box I add a number approx in the centre to create a "numbered button "  everything looks ok but I want to centre the number in the rectangle ie centre in the layer beneath. I tried using the align tools with selecting both the box and the number and failed.
In Photoshop it's easy so I'm sure it is in flash. So what am I mssing?
thanks
Ian

You cannot align the text within the TextArea itself.
If you could, that would result in quite a few
problems - for example, if you set the alignment to
the right and allowed people to type in the box,
should the words slowly march to the left as you
typed them in?
You can align the TextArea itself within the JPanel or
whatever component you use, with the functions
JTextArea.setAlignmentX( float Alignment ) and
JTextArea.setAlignmentY( float Alignment). Legal
values of alignment are:
BOTTOM_ALIGNMENT
CENTER_ALIGNMENT
LEFT_ALIGNMENT
RIGHT_ALIGNMENT
TOP_ALIGNMENT
Honestly, in the time you've spent waiting for this
answer, you could have easily looked it up yourself
at:
http://java.sun.com/j2se/1.4.1/docs/api/
Hi David, Thankyou for your reply. I have concluded the JTextArea Alignment procedure from my Docs/API. But I asked above not about JTextArea(swing). I asked, can I do the same thing in simple TextArea(AWT) instead of JTextArea .

Similar Messages

  • I need help with rectangle tool size/align

    Hey there !
    i've some trouble with a specific document. I could not align any rectangle or define a specific size. For exemple, i choose 600px x600 px in the top "menu" bar, illustrator change the values by 599,641 px
    It's the same in inch, mm..ect
    The second thing it's if i choose a specific coordonate to place the rectangle , it's change by illustrator.
    Any ideas ?
    I have not the problem on other document.
    It's a 21 cm 21cm @ 300 dpi, proprotions 1
    No grid activited or anything else to force the magnetism

    It was, but it doesn't change :/
    I've tried to created a new document, but with pixel dimension. then i change it in cm, and it's work..
    but if my document is created in mm or cm, it's just not work
    So i could not have a cm or mm document and precise rectangle size.. i have to create a whole number pixel document

  • Aligning borders on rectangle frames

    Hi,
    Did a quick search but did not come up with the answer.  I use adobe indesign occasionally so this is probably a fairly stupid question.  I am trying to align some rectangle frames to some guides.  (Assume I am using "Align Stroke to Center".)
    If I have a stroke of zero on the frames and then do my aligning to the guides, everything is fine.  The problem occurs when I change the stroke to something else (ie 6) BEFORE aligning.  The snap settings will no longer use the edge of the rectangle frame but instead use the outside of the stroke to align to.  This results in boxes that are now out by half a stroke width.  Am I missing something here? - Is there a way to change the snap settings?  Is it common practice to wait until the very end to apply strokes?
    Thanks,
    Rob
    CS4 and CS2

    Thanks for the reply but that will not work.  If you are simply placing a smaller box in a larger then it will but not if you are placing a box next to another by aligning to a guide.  Now the stroke width will essentially be twice what you wanted where the two boxes are aligned.
    Any other ideas?
    Rob

  • Smart Guides -Illustrator not really align rectangles CC2014

    I'm testing the new version of Illustrator CC 2014  in windows 8.1 and all good except new bounding box of the rectangle tool, and if I want to align two rectangles with the same valiéndome features Smart Guides, these do not really line up, how when I make eh I reached the point of alignment of the figure that I have reference, as when zooming clearly see that not align myself really, we should mention that I have enabled the option to align grid of pixels, and also this does not happen with other tools like ellipse, or polygon, rectangle and only rounded rectangle, examples:
    PD, and restore preferences, and reinstall the program and the problem persists

    axs,
    You may use old fashioned plain rectangles instead of live ones.
    To be able to create a normal old fashioned rectangle, you can use the free script created by Pawel, see this thread:
    https://forums.adobe.com/thread/1587587

  • How to align object in the report layout

    Hello,
    I find it very difficult to aligin objects in the report editor or in the template editor. I know there are some alignment options, like aligning to the grid or aligning a group of objects, but they seem to work on the bounding rectangle for the object. For my text objects, those rectangles are arbitrarily sized. So aligning those rectangles does not correctly align the text baseline, for example.
    Does anyone have a tip on how you can align objects? I there maybe a way to alter the size of objects by changing a number in a property sheet somewhere?
    Regards,
    Frans

    The problems I am having now occur when I am editing the margin in the template editor. For some reason, the flex and confine options can not be turned off in the template editor. I believe they are turned on in this mode, at least in tools:options: paper layout they are turned on. But anyway, this really does not matter because I don't have nested objects in the margin. The objects that will go flying off are completely unrelated to the object I want to move or resize.
    Update: I have just tried editing the layout of a report that was based on the template I am working on. Turning flex off there had a positive effect. It seems indeed the 'flex' setting is to blame for the problems I am experiencing. Thanks for the tip!
    So now I would really like to know how to turn of flex in the template editor..

  • How To Apply Similar Transformation Of One Layer To Another Without Duplicating?

    Hey there guys,
    This is my first post.
    I'm also new to Adobe Photoshop as well . I have a sample 3d eCover and I want to fit an image over the front part. However, I'm having a hard time transformating my image to perfectly the front layer. Is there any option to apply the same transformation of my front cover layer to my image?
    Additional infos:
    1. The front cover layer of the 3D eCover is not yet merged with the other layers. So, I can still edit it.
    2. I'm using Adobe Photoshop CS6.
    Thank you.

    Convert the untransformed image layer (or a duplicate of it) to Smart Object then use Edit > Transform > Distort to align the SO with the sample.
    The SO is not necessary but it has several benefits:
    Multiple transform sessions will not increasingly degrade the appearance.
    Each time you initiate a transform session, handles will be attached to the corners and edges of the SO instead of an axis-aligned bounding rectangle.
    It can be a template into which you load alternative images to instantly transform them.

  • Aligning text horizontally inside a rectangle shape?

    I have text on top of a rectangle made with a shape layer. I now want to align the text in the center of the rectangle shape. I select both layers, though the option to align the text sometimes shows and other times does not. When it does show the horizontal option is greyed out. How is this done?
    Thanks.

    With the Move Tool selected and no Selection active it should be no problem, could you please post a screenshot with the pertinent Panels visible?

  • Aligning Rectangles with Controls on the screen

    Happy New Year. Hope everyone enjoyed the holidays !
    I installed an application I developed in Visual Studio C# on some new laptops with wider higher resolution screens and sent them into the field. Everything works fine with the following exception. A key component to this application is the entry of time
    spent on customer sites. It is entered in 15 minute increments.  To aid the employee in entering the time I use radio controls and display the implied time in a graphic bar below the controls.
    When the same data is entered on one of the new laptops the rectangles no longer align with the correct radio controls. For example:
    The time is split into 24 hours in 15 minute increments. So the following loop works. The color of the rectangle is controlled by an entry in an array  initialized earlier in the code.  The Radio controls are located 20 units apart according the
    x,y coordinates in the radio control location property. So I make the width of the rectangle = 5 (20/4 fifteen minute segments) and calculate the left position. 
    So the question is: Why does this work on the old laptops, works on my development PC regardless of what resolution I set the screen, but does NOT align properly on the new laptops?
    Rectangle r = new Rectangle(2, 2, 20, 10); //left,top,width,heigth
    int width = 5;
    int top = 2;
    int height = 10;
    Bitmap bmp = new Bitmap(hourlyPictureBox.Width, hourlyPictureBox.Height);
    Graphics g = Graphics.FromImage(bmp);
    g.PageUnit = GraphicsUnit.Pixel;
    for (i = 0; i <= 100; i++)
        r = new Rectangle(4 + (i * width), top, width, height); //left,top,width,heigth
       if (slot[i] == 0)
              g.FillRectangle(Brushes.White, r);
       if (slot[i] == 1)
              g.FillRectangle(Brushes.red, r);
          ........so on and so forth for all the colors
    hourlyPictureBox.Image = bmp;
    Hopefully a simple question for someone who knows what they are doing. :=)
    Thank you in advance for your help in this matter.
    Rob

    Well.....after a couple of hours of frustration I found out that using floating # does not help. Everything had to work out to an integer so things would line up on each 15 minute increment.
    I also never figured out how to loop thru and reference the radio buttons, so a bunch of hard coded crap fixed my problem.  Code is ugly, but works.
    Thank you for heading me in the right direction to know what to look at. Devil is in the details.
    if ((radioButton54.Left) - (radioButton30.Left) > 600)
                    width = 7;
                    offset = 12;
                    radioButton2.Left = radioButton1.Left + (width * 4);
                    radioButton3.Left = radioButton2.Left + (width * 4);
                    radioButton4.Left = radioButton3.Left + (width * 4);
                    radioButton5.Left = radioButton4.Left + (width * 4);
                    radioButton6.Left = radioButton5.Left + (width * 4);
                    radioButton7.Left = radioButton6.Left + (width * 4);
                    radioButton8.Left = radioButton7.Left + (width * 4);
                    radioButton9.Left = radioButton8.Left + (width * 4);
                    radioButton10.Left = radioButton9.Left + (width * 4);
                    radioButton11.Left = radioButton10.Left + (width * 4);
                    radioButton12.Left = radioButton11.Left + (width * 4);
                    radioButton13.Left = radioButton12.Left + (width * 4);
                    radioButton14.Left = radioButton13.Left + (width * 4);
                    radioButton15.Left = radioButton14.Left + (width * 4);
                    radioButton16.Left = radioButton15.Left + (width * 4);
                    radioButton17.Left = radioButton16.Left + (width * 4);
                    radioButton18.Left = radioButton17.Left + (width * 4);
                    radioButton19.Left = radioButton18.Left + (width * 4);
                    radioButton20.Left = radioButton19.Left + (width * 4);
                    radioButton21.Left = radioButton20.Left + (width * 4);
                    radioButton22.Left = radioButton21.Left + (width * 4);
                    radioButton23.Left = radioButton22.Left + (width * 4);
                    radioButton24.Left = radioButton23.Left + (width * 4);
                    radioButton25.Left = radioButton24.Left + (width * 4);
                    st1.Left = radioButton1.Left - 4;
                    st2.Left = radioButton2.Left - 4;
                    st3.Left = radioButton3.Left - 4;
                    st4.Left = radioButton4.Left - 4;
                    st5.Left = radioButton5.Left - 4;
                    st6.Left = radioButton6.Left - 4;
                    st7.Left = radioButton7.Left - 4;
                    st8.Left = radioButton8.Left - 4;
                    st9.Left = radioButton9.Left - 4;
                    st10.Left = radioButton10.Left - 4;
                    st11.Left = radioButton11.Left - 4;
                    st12.Left = radioButton12.Left - 4;
                    st13.Left = radioButton13.Left - 4;
                    st14.Left = radioButton14.Left - 4;
                    st15.Left = radioButton15.Left - 4;
                    st16.Left = radioButton16.Left - 4;
                    st17.Left = radioButton17.Left - 4;
                    st18.Left = radioButton18.Left - 4;
                    st19.Left = radioButton19.Left - 4;
                    st20.Left = radioButton20.Left - 4;
                    st21.Left = radioButton21.Left - 4;
                    st22.Left = radioButton22.Left - 4;
                    st23.Left = radioButton23.Left - 4;
                    st24.Left = radioButton24.Left - 4;
                    pm13.Left = radioButton13.Left - 4;
                    pm14.Left = radioButton14.Left - 4;
                    pm15.Left = radioButton15.Left - 4;
                    pm16.Left = radioButton16.Left - 4;
                    pm17.Left = radioButton17.Left - 4;
                    pm18.Left = radioButton18.Left - 4;
                    pm19.Left = radioButton19.Left - 4;
                    pm20.Left = radioButton20.Left - 4;
                    pm21.Left = radioButton21.Left - 4;
                    pm22.Left = radioButton22.Left - 4;
                    pm23.Left = radioButton23.Left - 4;
                    pm24.Left = radioButton24.Left - 4;
                    radioButton31.Left = radioButton30.Left + (width * 4);
                    radioButton32.Left = radioButton31.Left + (width * 4);
                    radioButton33.Left = radioButton32.Left + (width * 4);
                    radioButton34.Left = radioButton33.Left + (width * 4);
                    radioButton35.Left = radioButton34.Left + (width * 4);
                    radioButton36.Left = radioButton35.Left + (width * 4);
                    radioButton37.Left = radioButton36.Left + (width * 4);
                    radioButton38.Left = radioButton37.Left + (width * 4);
                    radioButton39.Left = radioButton38.Left + (width * 4);
                    radioButton40.Left = radioButton39.Left + (width * 4);
                    radioButton41.Left = radioButton40.Left + (width * 4);
                    radioButton42.Left = radioButton41.Left + (width * 4);
                    radioButton43.Left = radioButton42.Left + (width * 4);
                    radioButton44.Left = radioButton43.Left + (width * 4);
                    radioButton45.Left = radioButton44.Left + (width * 4);
                    radioButton46.Left = radioButton45.Left + (width * 4);
                    radioButton47.Left = radioButton46.Left + (width * 4);
                    radioButton48.Left = radioButton47.Left + (width * 4);
                    radioButton49.Left = radioButton48.Left + (width * 4);
                    radioButton50.Left = radioButton49.Left + (width * 4);
                    radioButton51.Left = radioButton50.Left + (width * 4);
                    radioButton52.Left = radioButton51.Left + (width * 4);
                    radioButton53.Left = radioButton52.Left + (width * 4);
                    radioButton54.Left = radioButton53.Left + (width * 4);
                    et30.Left = radioButton30.Left-4;
                    et31.Left = radioButton31.Left - 4;
                    et32.Left = radioButton32.Left - 4;
                    et33.Left = radioButton33.Left - 4;
                    et34.Left = radioButton34.Left - 4;
                    et35.Left = radioButton35.Left - 4;
                    et36.Left = radioButton36.Left - 4;
                    et37.Left = radioButton37.Left - 4;
                    et38.Left = radioButton38.Left - 4;
                    et39.Left = radioButton39.Left - 4;
                    et40.Left = radioButton40.Left - 4;
                    et41.Left = radioButton41.Left - 4;
                    et42.Left = radioButton42.Left - 4;
                    et43.Left = radioButton43.Left - 4;
                    et44.Left = radioButton44.Left - 4;
                    et45.Left = radioButton45.Left - 4;
                    et46.Left = radioButton46.Left - 4;
                    et47.Left = radioButton47.Left - 4;
                    et48.Left = radioButton48.Left - 4;
                    et49.Left = radioButton49.Left - 4;
                    et50.Left = radioButton50.Left - 4;
                    et51.Left = radioButton51.Left - 4;
                    et52.Left = radioButton52.Left - 4;
                    et53.Left = radioButton53.Left - 4;
                    et54.Left = radioButton54.Left - 4;
                int top = 2;
                int height = 10;
                Bitmap bmp = new Bitmap(hourlyPictureBox.Width, hourlyPictureBox.Height);
                Graphics g = Graphics.FromImage(bmp);
                g.PageUnit = GraphicsUnit.Pixel;//??
                for (i = 0; i <= 100; i++)
                    int w = width;
                    int z = offset  + (i * width);
                    //r = new Rectangle(4 + (i * width)), top, width, height); //left,top,width,heigth
                    r = new Rectangle(z, top, w, height); //left,top,width,heigth
                    if (slot[i] == 0)
                        g.FillRectangle(Brushes.White, r);
      ......so on and so forth
                hourlyPictureBox.Image = bmp;
                g.Dispose();

  • Rectangle tools not aligning when publishing

    Left image is how i want it to look like, when i publish it looks like image on right!!!
    I HAVE NO IDEA WHY THIS IS HAPPENING! SO ANNOYING NEED HELP BIG TIME!!!!
    cheers guys!

    Hi Kezmania,
    I see that you have embedded some HTML code on this page. Please try to duplicate the page without the embedded HTML and see if that helps. Also, try to group the three rectangle using the Menu option, Object -> Group.
    If you still face the issue then send your .muse file and a link to this forum topic to my attention to [email protected] If your .muse file is larger than 20MB use a filesharing service like SendThisFile or Adobe SendNow.
    Regards,
    Abhishek Maurya

  • 3 questions regarding alignment, rectangle drawing, and a error I get

    3 Questions:
    ========================================
    1. Why does the DOS window in Code Warrior show this error in it, but it doesn't affect the operation of the applet?
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at PianoApplet.paint(PianoApplet.java)
    at sun.awt.RepaintArea.paint(RepaintArea.java:293)
    at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:191)
    at java.awt.Component.dispatchEventImpl(Component.java:2658)
    at java.awt.Container.dispatchEventImpl(Container.java:1208)
    at java.awt.Component.dispatchEvent(Component.java:2492)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
    read.java:126)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:93)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at PianoApplet.paint(PianoApplet.java)
    at java.awt.Container.update(Container.java:976)
    at sun.awt.RepaintArea.update(RepaintArea.java:332)
    at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:195)
    at java.awt.Component.dispatchEventImpl(Component.java:2658)
    at java.awt.Container.dispatchEventImpl(Container.java:1208)
    at java.awt.Component.dispatchEvent(Component.java:2492)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
    read.java:126)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:93)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
    ===========================================
    Second Question
    How do I align this so that it is is on the right on the applet, cause it overlaps my keyboard when I just place it.
    private TextArea intro = new TextArea("Welcome to the PianoApplet! \nHere you will be able to play a full sized octave of keys. \nClick a key to play the key. \nYou can also drag your mouse across the keyboard \nand play multiple notes at once.", 5, 40);
    ===========================================
    Third Question
    When I do this:
    if(state.equals("duh")){
    g.setColor(Color.green);
    g.fillRect(150,50,40,90);
    g.drawImage(iduh,100, 200, this);
    It colors everything green, not just the duh key, it also colors the duh sharp, reh, and half the reh sharp. Why is that?
    =========================================
    Please answer any of my questions.
    Thanks.
    ==========
    My Code
    ==========
    import java.awt.*;
    import java.applet.Applet;
    import javax.swing.*;
    import java.awt.event.*;
    import java.applet.AudioClip;
    public class PianoApplet extends Applet implements MouseListener, MouseMotionListener {
    private Point mouse = new Point();
    //private TextField output=new TextField(30);
    //private TextArea intro = new TextArea("Welcome to the PianoApplet! \nHere you will be able to play a full sized octave of keys. \nClick a key to play the key. \nYou can also drag your mouse across the keyboard \nand play multiple notes at once.", 5, 40);
    private String state = null;
    //The images
    private Image iduh, ire, ime, ifa, isol, ila, isi, iduh2, iduhsharp, iemptynotes, ifasharp, ilasharp, iresharp, isolsharp;
    //The sounds
    AudioClip duh;
    AudioClip re;
    AudioClip me;
    AudioClip fa;
    AudioClip sol;
    AudioClip la;
    AudioClip si;
    AudioClip duh2;
    AudioClip b0;
    AudioClip b1;
    AudioClip b2;
    AudioClip b3;
    AudioClip b4;
    public void init(){
    //load images of notes here
    iduh = getImage(getCodeBase(), "duh.jpg");
    ire = getImage(getCodeBase(), "re.jpg");
    ime = getImage(getCodeBase(), "me.jpg");
    ifa = getImage(getCodeBase(), "fa.jpg");
    isol = getImage(getCodeBase(), "sol.jpg");
    ila = getImage(getCodeBase(), "la.jpg");
    isi = getImage(getCodeBase(), "si.jpg");
    iduh2 = getImage(getCodeBase(), "duh2.jpg");
    iduhsharp = getImage(getCodeBase(), "duhsharp.jpg");
    iemptynotes = getImage(getCodeBase(), "emptynotes.jpg");
    ifasharp = getImage(getCodeBase(), "fasharp.jpg");
    ilasharp = getImage(getCodeBase(), "lasharp.jpg");
    iresharp = getImage(getCodeBase(), "resharp.jpg");
    isolsharp = getImage(getCodeBase(), "solsharp.jpg");
    //load sounds of piano here
    duh = getAudioClip(getCodeBase(),"duh.au");
    re = getAudioClip(getCodeBase(),"re.au");
    me = getAudioClip(getCodeBase(),"me.au");
    fa = getAudioClip(getCodeBase(),"fa.au");
    sol = getAudioClip(getCodeBase(),"sol.au");
    la = getAudioClip(getCodeBase(),"la.au");
    si = getAudioClip(getCodeBase(),"si.au");
    duh2 = getAudioClip(getCodeBase(),"duh2.au");
    b0 = getAudioClip(getCodeBase(),"b0.au");
    b1 = getAudioClip(getCodeBase(),"b1.au");
    b2 = getAudioClip(getCodeBase(),"b2.au");
    b3 = getAudioClip(getCodeBase(),"b3.au");
    b4 = getAudioClip(getCodeBase(),"b4.au");
    addMouseListener(this);
    addMouseMotionListener(this);
    //add(output);
    setSize(750,300);
    //add(intro);
    public void paint(Graphics g) {
    g.setColor(Color.black);
    g.drawRect(150,50,40,90); g.fillRect(165,50,12,60);
    g.drawRect(170,50,40,90);
    g.fillRect(185,50,12,60);
    g.drawRect(190,50,40,90);
    g.drawRect(210,50,40,90);
    g.fillRect(225,50,12,60);
    g.drawRect(230,50,40,90);
    g.fillRect(245,50,12,60);
    g.drawRect(250,50,40,90);
    g.fillRect(265,50,12,60);
    g.drawRect(270,50,40,90);
    g.drawImage(iemptynotes,100, 200, this);
    if(state.equals("duh")){
    g.setColor(Color.green);
    g.fillRect(150,50,40,90);
    g.drawImage(iduh,100, 200, this);
    if(state.equals("re")){
    g.drawImage(ire,100, 200, this);
    if(state.equals("me")){
    g.drawImage(ime,100, 200, this);
    if(state.equals("fa")){
    g.drawImage(ifa,100, 200, this);
    if(state.equals("sol")){
    g.drawImage(isol,100, 200, this);
    if(state.equals("la")){
    g.drawImage(ila,100, 200, this);
    if(state.equals("si")){
    g.drawImage(isi,100, 200, this);
    if(state.equals("duh2")){
    g.drawImage(iduh2,100, 200, this);
    if(state.equals("b0")){
    g.drawImage(iduhsharp,100, 200, this);
    if(state.equals("b2")){
    g.drawImage(ifasharp,100, 200, this);
    if(state.equals("b4")){
    g.drawImage(ilasharp,100, 200, this);
    if(state.equals("b1")){
    g.drawImage(iresharp,100, 200, this);
    if(state.equals("b3")){
    g.drawImage(isolsharp,100, 200, this);
    public void mouseClicked(MouseEvent e){
    mouse = e.getPoint();
    //output.setText("x: " + mouse.x + " y: " + mouse.y);
    repaint();
    if (((50<mouse.y && mouse.y<110) && (150<mouse.x && mouse.x<165)) || ((110<mouse.y && mouse.y<140) && (150<mouse.x && mouse.x<170)))
    //setBackground(Color.green);
    duh.play();
    state = "duh";
    repaint();
    System.out.println("Duh");
    else if (((50<mouse.y && mouse.y<110) && (165<mouse.x && mouse.x<175)))
    b0.play();
    state = "b0";
    repaint();
    System.out.println("b0");
    else if (((50<mouse.y && mouse.y<110) && (175<mouse.x && mouse.x<185)) || ((110<mouse.y && mouse.y<140) && (170<mouse.x && mouse.x<190)))
    re.play();
    state = "re";
    repaint();
    System.out.println("reh");
    else if (((50<mouse.y && mouse.y<110) && (185<mouse.x && mouse.x<195)))
    b1.play();
    state = "b1";
    repaint();
    System.out.println("b1");
    else if (((50<mouse.y && mouse.y<110) && (195<mouse.x && mouse.x<210)) || ((110<mouse.y && mouse.y<140) && (190<mouse.x && mouse.x<210)))
    me.play();
    state = "me";
    repaint();
    System.out.println("me");
    else if (((50<mouse.y && mouse.y<110) && (210<mouse.x && mouse.x<225)) || ((110<mouse.y && mouse.y<140) && (210<mouse.x && mouse.x<230)))
    fa.play();
    state = "fa";
    repaint();
    System.out.println("fa");
    else if (((50<mouse.y && mouse.y<110) && (225<mouse.x && mouse.x<235)))
    b2.play();
    state = "b2";
    repaint();
    System.out.println("b2");
    else if (((50<mouse.y && mouse.y<110) && (235<mouse.x && mouse.x<245)) || ((110<mouse.y && mouse.y<140) && (235<mouse.x && mouse.x<250)))
    sol.play();
    state = "sol";
    repaint();
    System.out.println("sol");
    else if (((50<mouse.y && mouse.y<110) && (245<mouse.x && mouse.x<255)))
    b3.play();
    state = "b3";
    repaint();
    System.out.println("b3");
    else if (((50<mouse.y && mouse.y<110) && (255<mouse.x && mouse.x<265)) || ((110<mouse.y && mouse.y<140) && (255<mouse.x && mouse.x<270)))
    la.play();
    state = "la";
    repaint();
    System.out.println("la");
    else if (((50<mouse.y && mouse.y<110) && (265<mouse.x && mouse.x<275)))
    b4.play();
    state = "b4";
    repaint();
    System.out.println("b4");
    else if (((50<mouse.y && mouse.y<110) && (275<mouse.x && mouse.x<290)) || ((110<mouse.y && mouse.y<140) && (270<mouse.x && mouse.x<290)))
    si.play();
    state = "si";
    repaint();
    System.out.println("si");
    else if (((50<mouse.y && mouse.y<140) && (290<mouse.x && mouse.x<310)))
    duh2.play();
    state = "duh2";
    repaint();
    System.out.println("duh");
    public void mouseDragged(MouseEvent e) {
    //output.setText("x: " + mouse.x + " y: " + mouse.y);
    mouse = e.getPoint();
    repaint();
    if (((50<mouse.y && mouse.y<110) && (150<mouse.x && mouse.x<165)) || ((110<mouse.y && mouse.y<140) && (150<mouse.x && mouse.x<170)))
    //setBackground(Color.green);
    duh.play();
    state = "duh";
    repaint();
    System.out.println("Duh");
    else if (((50<mouse.y && mouse.y<110) && (165<mouse.x && mouse.x<175)))
    b0.play();
    state = "b0";
    repaint();
    System.out.println("b0");
    else if (((50<mouse.y && mouse.y<110) && (175<mouse.x && mouse.x<185)) || ((110<mouse.y && mouse.y<140) && (170<mouse.x && mouse.x<190)))
    re.play();
    state = "re";
    repaint();
    System.out.println("reh");
    else if (((50<mouse.y && mouse.y<110) && (185<mouse.x && mouse.x<195)))
    b1.play();
    state = "b1";
    repaint();
    System.out.println("b1");
    else if (((50<mouse.y && mouse.y<110) && (195<mouse.x && mouse.x<210)) || ((110<mouse.y && mouse.y<140) && (190<mouse.x && mouse.x<210)))
    me.play();
    state = "me";
    repaint();
    System.out.println("me");
    else if (((50<mouse.y && mouse.y<110) && (210<mouse.x && mouse.x<225)) || ((110<mouse.y && mouse.y<140) && (210<mouse.x && mouse.x<230)))
    fa.play();
    state = "fa";
    repaint();
    System.out.println("fa");
    else if (((50<mouse.y && mouse.y<110) && (225<mouse.x && mouse.x<235)))
    b2.play();
    state = "b2";
    repaint();
    System.out.println("b2");
    else if (((50<mouse.y && mouse.y<110) && (235<mouse.x && mouse.x<245)) || ((110<mouse.y && mouse.y<140) && (235<mouse.x && mouse.x<250)))
    sol.play();
    state = "sol";
    repaint();
    System.out.println("sol");
    else if (((50<mouse.y && mouse.y<110) && (245<mouse.x && mouse.x<255)))
    b3.play();
    state = "b3";
    repaint();
    System.out.println("b3");
    else if (((50<mouse.y && mouse.y<110) && (255<mouse.x && mouse.x<265)) || ((110<mouse.y && mouse.y<140) && (255<mouse.x && mouse.x<270)))
    la.play();
    state = "la";
    repaint();
    System.out.println("la");
    else if (((50<mouse.y && mouse.y<110) && (265<mouse.x && mouse.x<275)))
    b4.play();
    state = "b4";
    repaint();
    System.out.println("b4");
    else if (((50<mouse.y && mouse.y<110) && (275<mouse.x && mouse.x<290)) || ((110<mouse.y && mouse.y<140) && (270<mouse.x && mouse.x<290)))
    si.play();
    state = "si";
    repaint();
    System.out.println("si");
    else if (((50<mouse.y && mouse.y<140) && (290<mouse.x && mouse.x<310)))
    duh2.play();
    state = "duh2";
    repaint();
    System.out.println("duh");
    public void mouseEntered(MouseEvent e){ }
    public void mouseExited(MouseEvent e){ }
    public void mousePressed(MouseEvent e){ }
    public void mouseReleased(MouseEvent e){ }
    public void mouseMoved(MouseEvent e){ }
    }

    question 2:
    BFI answer:
    put everything you have in a panel
    put your text area beside it.
    question 1:
    something about painting a .java file just seems wrong.
    question 3:
    because you told it to.

  • Text put into a canvas element with context.fillText() always has a black box where each letter goes. If the text is black you just see the black rectangle. If the text is not black you see it on the black bounding box. Surely this is not right.

    This has happened on the last few versions of firefox, as long as canvas has been supported. I see other people's screen shots from canvas tutorials, and the text always looks normal. On my system, any text put into a canvas element via context.fillText() will have a black bounding box for each letter, sized appropriately for the letter. If the text is black, of course you only see rectangles. If the text is a contrasting color, then you can read it, but it looks bizarre.

    Thomas...same kind of crap here.
    I used Custom Text - entered a sentence, hit return, entered another.
    Set to 72 pt.
    The default alignment is centred - I want left aligned text...the text start point stays at the centre of frame and the sentence runs off the edge of the bounding box.
    There is no settings in the Text or Title inspector dialog to correct that!
    Using Transform will not sort it!

  • Animated Gif - Aligning Multiple layers

    Hi All
    I am creating a rotating animated gif in PS. Now I have about 37 layers, where I increment the angle of each layer with 10 degress relative to the previous one. But even when aligning all my layers with the aligning tools the layers still not align...How can I align them perfectly? See what I mean on the image below here:
    NOTE: If the gif here does not animate, see this link:
    You can see it is off-center

    DexterDave wrote:
    @JJMack. I am not sure how to rotate the layer without the older frame copying the new rotated position...that is why I used copies of layers
    You do copy the layer and rotate. The layer needs to be perfectly aligned to the center of a is square 1:1 aspect ratio canvas. Guide lines were added 50% Horizontal and Vertically three were added a 49%, 50% and 51%. Then using the elliptical tool set to path mode a circle path was drawn by holding down the Alt key so the path would be from the center and holding the shift key down so the ellipse would be constrain to a circle. You click at the 50% 50% crossed guide line which the mouse pointer snaps to and you drag out the first otter circle.  You then set the path mode to subtract and drag out the inner circle.  Your path is now a ring. Then switch you the rectangle tool and subtract a rectangle path using the 49% and 51% guide lines. Your Path is now two arcs. Create two filled Shape layers the colors in the ring delete 1/2 of the layer so you have two colored arcs. Rastersize the two and merge the two layers int one.  You now have you arcs aligned from the center.  Next the action its simple dupe the layer rotate the layer 10 degrees select previous layer turn off visibility select layer forward.  Play this action till you the required 36 ring layers. Create a frame animation have Photoshop make frames from the layers using the frame animation palette's fly-out option.  Delete the first IK frames and turn on the IK layer visibility in what in now the first frame. It will turn on in all frames. You the save for web the animated gif. PSD file http://mouseprints.net/old/dpr/ik.psd  also tried using a smart object ring layer to loose less quality rotating the layer however there seem to be movement in the rotation.  Photoshop may be having a problem dealing wit the transparency in the layer and the break in the circle. http://mouseprints.net/old/dpr/ikso.psd so then I put all the ring layers into a group and masked the group with a vector mask. http://mouseprints.net/old/dpr/iksomask.psd  the best tool you have when using Photoshop is the gray matter between your ears let it do its thing it may even surprise you sometimes.

  • How can I disable making live shape rectangle in the first place but normal one instead in Illustrator CC?

    How can I disable making live shape rectangle in the first place but normal one instead in Illustrator CC? When I create rectangle I can't transform it by dragging and it's only the problem with rectangle, not with circle, star etc. I try show/hide edges/bounding box reset preferences and reinstall whole illustrator CC and it's the same. I can only make this right by expand this rectangle, which is shape as is turn out to rectangle by clicking object>shape>expand rectangle. But this is so frustrating. Help!:) oh, and I use OSX. My friend has the same specs and it's works. I mean she can use live shape corner transformations and changing size by draging:(

    I’ve created my own plugin (available for free for personal and commercial use) which imitates behavior of the ‘old’ Rectangle Tool. It doesn’t replace the Live Rectangle – it works completely independent!
    My Plain Rectangle Tool correctly snaps to grids/objects/points and correctly aligns to grid/points on resize. Of course it supports the SHIFT and ALT/OPTION keys, Snap to Grid and Smart Guides options. In other words it works almost 100% the same as the Rectangle Tool we know from CC (17.1), CS6 and earlier.
    The installation package (zxp) adds ‘Plain Rectangle Tool’ icon into the Ai panel (of curse you can assign your custom keyboard shortcut to it as well)
    Note: The Plain Rectangle can be easily converted into the Live one using Object > Shape > Convert to Rectangle
    Grab your copy at http://63mutants.com/subc/products/PlainRectangleTool_m01/PlainRectangleTool_m01.php Feel free to share with your friends. It’s completely free.
    I’ve also created a separate discussion https://forums.adobe.com/thread/1587587 for the Plain Rectangle Tool. If you have any comments or request please post it there. Any feedback would be greatly appreciated!
    Thanks,
    Pawel Kuc

  • Is paragraph alignment possible in RH 6 HTML?

    Hi all,
    Most of the topics I've created include text boxes, tables, and screen shots - all of which I can set the size for best viewing. But so far I haven't been able to find a way to control the paragraph text so that it doesn't stretch beyond the boxes, tables, and images when accessing the help pages without the content pane (TOC) open or having to minimize the page size. I've tried using the margin ruler, the paragraph alignment, and the page setup function, but nothing seems to do the trick. What I'm aiming for is nicely alignment topic when opened as a single help page or as part of a manual w/TOC.
    I'd appreciate your input. Thanks!

    Hi there
    You are probably looking for something RoboHelp doesn't help you with easily.
    If you hand edit the HTML code, you can insert a DIV on the page to make it adhere to a specific width.
    Basically the HTML *MAY* look something like this:
    This may make the editor look a bit odd as things are now inside a dotted rectangle frame. But it should work.
    Cheers... Rick
    Begin learning RoboHelp HTML 7 within the day - $24.95!
    Click here for Adobe Certified Captivate and RoboHelp HTML Training
    Click here for the SorcerStone Blog
    Click here for RoboHelp and Captivate eBooks

  • How to align the item text in the combobox vertically centred after increasing the height of the combobox in mfc?

    I want to make the item text of the combobox to  be aligned vertically(Centred) . Actually I increased the height 
    of the combobox and after the increasing the combobox height, the text is not centred vertically.The code
    snippet for increasing the height is as follows,
    m_SpecifyCombo.SetItemHeight(-1,20);//CCombobox m_SpecifyCombo
    After increasing the height the text in the combobox is not in the centre as shown in the below image,
    But I want the text to be centred as shown in the below image.
    Code snippet for owner drawn combobox:
    #if !defined(AFX_CUSTCOMBOBOX_H__F8528B4F_396E_11D1_9384_00A0248F6145__INCLUDED_)
    #define AFX_CUSTCOMBOBOX_H__F8528B4F_396E_11D1_9384_00A0248F6145__INCLUDED_
    #if _MSC_VER >= 1000
    #pragma once
    #endif // _MSC_VER >= 1000
    typedef enum {FONTS} STYLE; //Why have I enumerated, Cos, Maybe I might want something other than Fonts here
    class COwnerDrawCombo : public CComboBox
    // Construction
    public:
    COwnerDrawCombo();
    COwnerDrawCombo (STYLE);
    // Attributes
    public:
    void SetHilightColors (COLORREF hilight,COLORREF hilightText)
    m_clrHilight = hilight;
    m_clrHilightText = hilightText;
    void SetNormalColors (COLORREF clrBkgnd,COLORREF clrText)
    m_clrNormalText = clrText;
    m_clrBkgnd = clrBkgnd;
    static BOOL CALLBACK EnumFontProc (LPLOGFONT lplf, LPTEXTMETRIC lptm, DWORD dwType, LPARAM lpData);
    void FillFonts ();
    int GetSelFont (LOGFONT&);
    // Operations
    public:
    // Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CCustComboBox)
    public:
    virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
    virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
    protected:
    virtual void PreSubclassWindow();
    //}}AFX_VIRTUAL
    // Implementation
    public:
    virtual ~COwnerDrawCombo();
    // Generated message map functions
    protected:
    STYLE m_enStyle;
    COLORREF m_clrHilight;
    COLORREF m_clrNormalText;
    COLORREF m_clrHilightText;
    COLORREF m_clrBkgnd;
    BOOL m_bInitOver;
    void DrawDefault (LPDRAWITEMSTRUCT);
    void DrawFont(LPDRAWITEMSTRUCT);
    void InitFonts ();
    //{{AFX_MSG(CCustComboBox)
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
    afx_msg void OnDestroy();
    //}}AFX_MSG
    afx_msg long OnInitFonts (WPARAM, LPARAM);
    DECLARE_MESSAGE_MAP()
    //{{AFX_INSERT_LOCATION}}
    // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
    #endif //!defined(AFX_CUSTCOMBOBOX_H__F8528B4F_396E_11D1_9384_00A0248F6145__INCLUDED_)
    // OwnerDrawCombo.cpp : implementation file
    #include "stdafx.h"
    #include "combobox.h"
    #include "OwnerDrawCombo.h"
    #ifdef _DEBUG
    #define new DEBUG_NEW
    #undef THIS_FILE
    static char THIS_FILE[] = __FILE__;
    #endif
    #define WM_INITFONTS (WM_USER + 123)
    //I chose 123 cos nobody might use the same exact number.. I can improve this by use RegisterWindowMessage..
    // COwnerDrawCombo
    //Initial values of the text and highlight stuff
    COwnerDrawCombo::COwnerDrawCombo()
    m_enStyle = FONTS;
    m_clrHilight = GetSysColor (COLOR_HIGHLIGHT);
    m_clrNormalText = GetSysColor (COLOR_WINDOWTEXT);
    m_clrHilightText = GetSysColor (COLOR_HIGHLIGHTTEXT);
    m_clrBkgnd = GetSysColor (COLOR_WINDOW);
    m_bInitOver = FALSE;
    COwnerDrawCombo::COwnerDrawCombo (STYLE enStyle)
    m_enStyle = enStyle;
    m_clrHilight = GetSysColor (COLOR_HIGHLIGHT);
    m_clrNormalText = GetSysColor (COLOR_WINDOWTEXT);
    m_clrHilightText = GetSysColor (COLOR_HIGHLIGHTTEXT);
    m_clrBkgnd = GetSysColor (COLOR_WINDOW);
    m_bInitOver =FALSE;
    COwnerDrawCombo::~COwnerDrawCombo()
    BEGIN_MESSAGE_MAP(COwnerDrawCombo, CComboBox)
    //{{AFX_MSG_MAP(COwnerDrawCombo)
    ON_WM_CREATE()
    ON_WM_DESTROY()
    //}}AFX_MSG_MAP
    ON_MESSAGE (WM_INITFONTS,OnInitFonts)
    END_MESSAGE_MAP()
    // COwnerDrawCombo message handlers
    void COwnerDrawCombo::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
    //I might want to add something else someday
    switch (m_enStyle)
    case FONTS:
    DrawFont(lpDrawItemStruct);
    break;
    //I dont need the MeasureItem to do anything. Whatever the system says, it stays
    void COwnerDrawCombo::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct)
    void COwnerDrawCombo::DrawFont(LPDRAWITEMSTRUCT lpDIS)
    CDC* pDC = CDC::FromHandle(lpDIS->hDC);
    CRect rect;
    TRACE0 ("In Draw Font\n");
    // draw the colored rectangle portion
    rect.CopyRect(&lpDIS->rcItem);
    pDC->SetBkMode( TRANSPARENT );
    if (lpDIS->itemState & ODS_SELECTED)
    pDC->FillSolidRect (rect,m_clrHilight);
    pDC->SetTextColor (m_clrHilightText);
    else
    pDC->FillSolidRect (rect,m_clrBkgnd);
    pDC->SetTextColor (m_clrNormalText);
    if ((int)(lpDIS->itemID) < 0) // Well its negetive so no need to draw text
    else
    CString strText;
    GetLBText (lpDIS->itemID,strText);
    CFont newFont;
    CFont *pOldFont;
    ((LOGFONT*)lpDIS->itemData)->lfHeight = 90; //9 point size
    ((LOGFONT*)lpDIS->itemData)->lfWidth = 0;
    newFont.CreatePointFontIndirect ((LOGFONT*)lpDIS->itemData);
    pOldFont = pDC->SelectObject (&newFont);
    pDC->DrawText(strText, rect, DT_LEFT | DT_VCENTER | DT_SINGLELINE);
    pDC->SelectObject (pOldFont);
    newFont.DeleteObject ();
    void COwnerDrawCombo::InitFonts ()
    CDC *pDC = GetDC ();
    ResetContent (); //Delete whatever is there
    EnumFonts (pDC->GetSafeHdc(),NULL,(FONTENUMPROC) EnumFontProc,(LPARAM)this);//Enumerate
    m_bInitOver = TRUE;
    BOOL CALLBACK COwnerDrawCombo::EnumFontProc (LPLOGFONT lplf, LPTEXTMETRIC lptm, DWORD dwType, LPARAM lpData)
    if (dwType == TRUETYPE_FONTTYPE) //Add only TTF fellows, If you want you can change it to check for others
    int index = ((COwnerDrawCombo *) lpData)->AddString(lplf->lfFaceName);
    LPLOGFONT lpLF;
    lpLF = new LOGFONT;
    CopyMemory ((PVOID) lpLF,(CONST VOID *) lplf,sizeof (LOGFONT));
    ((COwnerDrawCombo *) lpData)->SetItemData (index,(DWORD) lpLF);
    return TRUE;
    int COwnerDrawCombo::OnCreate(LPCREATESTRUCT lpCreateStruct)
    if (CComboBox::OnCreate(lpCreateStruct) == -1)
    return -1;
    // TODO: Add your specialized creation code here
    if (m_enStyle == FONTS)
    //SetItemHeight(-1,30);
    PostMessage (WM_INITFONTS,0,0);
    return 0;
    long COwnerDrawCombo::OnInitFonts (WPARAM, LPARAM)
    InitFonts ();
    return 0L;
    void COwnerDrawCombo::OnDestroy()
    if (m_enStyle == FONTS)
    int nCount;
    nCount = GetCount ();
    for (int i = 0; i < nCount; i++)
    delete ((LOGFONT*)GetItemData (i)); //delete the LOGFONTS actually created..
    // TODO: Add your message handler code here
    CComboBox::OnDestroy();
    void COwnerDrawCombo::FillFonts ()
    m_enStyle = FONTS;
    PostMessage (WM_INITFONTS,0,0); //Process in one place
    int COwnerDrawCombo::GetSelFont (LOGFONT& lf)
    int index = GetCurSel ();
    if (index == LB_ERR)
    return LB_ERR;
    LPLOGFONT lpLF = (LPLOGFONT) GetItemData (index);
    CopyMemory ((PVOID)&lf, (CONST VOID *) lpLF, sizeof (LOGFONT));
    return index; //return the index here.. Maybe the user needs it:-)
    void COwnerDrawCombo::PreSubclassWindow()
    // TODO: Add your specialized code here and/or call the base class
    //Tried to do what Roger Onslow did for the button.. Did not work..?? Any R&D guys around :-)
    Can anyone please let me know how can I achieve this.
    Any help can be appreciated.
    Thanks in advance
    SivaV

    Hi sivavuyyuru,
    I cannot find a easy way to make this.
    I think you may need to draw your own Combo Box control. And you could change the edit control more like static text. Check the article:
    http://www.codeguru.com/cpp/controls/combobox/fontselectioncombos/article.php/c1795/Owner-Drawn-Font-Selection-Combobox.htm
    In the resource editor, Owner draw -> variable , Has string->true, type->drop list.
    The result:
    Best regards,
    Shu Hu
    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.

Maybe you are looking for

  • Jam Pack 2 & 3 loops don't show in loop browser

    When I add the Jam Pack 2 & 3 loops to the loop browser, they do not appear-how can I get the loops to show up ?

  • How to Create Event polling table

    hi, 1)How to Create Event polling table 2) wahts RPD stands for. 3) when we are prefer Dynamic variables. thanks. raj

  • Can't access desktop Mac from Laptop Mac via Airport/Ethernet

    Hi. I have an iMac G5 running 10.3.9 and a MacBook Pro running 10.4.8. I have recently gotten DSL. I have a DSL MODEM connected to a Belkin Router. The router is not wireless. I bought it when I got the iMac a couple of years ago, and the iMac had no

  • Indesign trial version Windows vista

    Hi There, I use Windows Vista (32 bit system, 4 GB RAM) and wanted to download a trial version of Indesign. Unfortunately, the CC version does obviously not support Windows Vista. CS6 or CS5 would also be ok for the beginning, but for this versions I

  • Macbook pro will not restart from sleep

    My MacBook Pro Intel fails to restart from sleep mode. The color beach ball just keeps spinning. The software is up to date and the computer is running Snow Leopard. Please help.