Using actionListeners to move a line 20 pixels in every direction

I'm trying to create an actionListener for a button. I need to be able to click on the button and move a line 20 pixels in every direction. But i have no idea how to do this. I'm supposed to have an object in my ColoredLine class that allows for me to use with the ActionListener class but I don't even know what that means. Here is my ButtonForLine class that implements listener and my ColoredLine class that gives the original line.
public class ButtonForLine implements ActionListener {
          public int q;
          public int w;
          public int e;
          public int r;
          public Color color;     
public void actionPerformed ( ActionEvent e ) {
     ColoredLine move= new ColoredLine;
public ButtonForLine( ) {
     q = (left + 20);
     w = (top + 20);
     e = (right + 20);
     r = (bottom + 20);
public class ColoredLine implements Drawable {          //creates all instance fields for entire class
     private int left;          //colored lines store the positions of their left, top, right, bottom, and color
     private int top;          // of their lines. It also stores the same positions for the twin lines.
     private int right;
     private int bottom;
     private Color color;
     private int q;
     private int w;
     private int e;
     private int r;
Creates a colored line. It calls for the new positons of the color swatch.
@param x1 the top left of the line
@param y1 the top of the line
@param x2 the bottom right of the line
@param y2 the bottom of the line
@param c the color of the line
public ColoredLine( int x1, int y1, int x2, int y2, Color c) {
     left = x1;
     top = y1;
     right = x2;
     bottom = y2;
     color = c;
Draw a colored line using a graphics context
@param g the graphics context used to draw the line
public void draw( Graphics2D g ) {
     g.setColor( color );
     g.drawLine( left, top, right, bottom );
public ColoredLine move() {
     q= (left + 20);
     w= (top + 20);
     e= (right + 20);
     r= (bottom + 20);
     ColoredLine moved = new ColoredLine( q, w, e, r, color );
     return moved;
}

[jverd's point|http://forums.sun.com/thread.jspa?messageID=10854585#10854585] was not necessarily to repost this question under a different title (much better title, BTW).
But you seem to have missed point 2). Please use the code tags when posting code, code snippets, HTML/XML or input/output.
Note as well, that the message posting form offers a tab at the top to 'Preview' a post - to see how it will look in the forum.

Similar Messages

  • How to cancel a Move Order line using API

    Hi
    I have a requirement, where I have to cancel Move order lines.
    At times, multiple Move order lines are getting created for the same Sales order line.
    Even after the Sales Order line is shipped and closed, the move order line is still open and it also has a corresponding pending transaction in mtl_material_transactions_temp table.
    I came across INV_MOVE_ORDER_PUB.process move order line API.
    how do I use it to cancel the move order line. Any sample codes would be highly welcome.
    Thanks

    Finally, found an alternate solution.
    used the following code.
    ===================================
    SET serveroutput on size 1000000
    DECLARE
    l_return_status VARCHAR2(100);
    l_msg_count NUMBER;
    l_msg_data VARCHAR2(2000);
    l_msg_index NUMBER;
    l_user_id NUMBER;
    l_resp_id NUMBER;
    l_appl_id NUMBER;
    l_org_id NUMBER := &org_id;
    l_move_order_line_id NUMBER := &mo_line_id ;
    BEGIN
    SELECT user_id
    INTO l_user_id
    FROM fnd_user
    WHERE user_name = 'PRAWILNSON';
    SELECT responsibility_id
    ,application_id
    INTO l_resp_id
    ,l_appl_id
    FROM fnd_responsibility_vl
    WHERE responsibility_name = 'Order Management Super User';
    FND_GLOBAL.apps_initialize (l_user_id, l_resp_id, l_appl_id);
    MO_GLOBAL.set_policy_context ('S', l_org_id);
    MO_GLOBAL.init;
    DBMS_OUTPUT.put_line ('Calling INV_MO_BACKORDER_PVT to Backorder MO');
    DBMS_OUTPUT.put_line ('===============================');
    inv_mo_backorder_pvt.backorder (p_line_id => l_move_order_line_id
    ,x_return_status => l_return_status
    ,x_msg_count => l_msg_count
    ,x_msg_data => l_msg_data);
    DBMS_OUTPUT.put_line ('Return Status is : '|| l_return_status);
    -- Check Return Status
    IF l_return_status = fnd_api.g_ret_sts_success THEN
    DBMS_OUTPUT.put_line ('Successfully BackOrdered the Move Order Line');
    COMMIT;
    ELSE
    DBMS_OUTPUT.put_line ('Could not able to Back Order Line Due to Following Reasons' );
    ROLLBACK;
    FOR j IN 1 .. l_msg_count LOOP
    FND_MSG_PUB.get(p_msg_index => j
    ,p_encoded => fnd_api.g_false
    ,p_data => l_msg_data
    ,p_msg_index_out => l_msg_index);
    DBMS_OUTPUT.put_line ('Error Message is : '|| l_msg_data);
    END LOOP;
    END IF;
    END;
    /

  • Mysterious line of pixels

    (New to Discussions)
    Problem- I'm getting these weird lines appearing on both the Macbook Pro LCD and my external LCD. It happens completely random and no crashing of apps occurs. It shows up on the desktop, Safari, FCP, and almost all other apps. It's not that big of a deal and sometimes you can move a Finder window over it to make it disappear. But it is bothering me when doing some editing and web design. I have captured a screenshot of it occurring in Safari.
    http://www.sethmccollum.info/Picture_1.png

    I have this as well, and it has been an issue for about 3 or 4 months now. I thought it could be an overheating issue, but have seen it happen when I have SMC fans running max speed and my MBP being at a low temp.
    I wish someone knew what was causing this.
    Also, i had spilt water on my AC adapter about 7 months ago, and it ran fine until just recently it started to smoke so I went ahead and bought a new ac adapter...one of my thoughts was that my bad Ac adapter was sending too high of a voltage causing graphical errors within my MBP...not sure if that is the case cause I have not seen any of these lines of pixels since I bought a new adapter. Along with these pixel lines everyone is seeing, my computer sometimes freezes when using graphics heavy programs (Photoshop/iphoto/watching a video on iTunes @ same time ect) And am not sure if it is linked to the graphical pixel lines.
    Hope someone can help, here is a picture of the pixel lines I managed to get:
    [IMG]http://i2.photobucket.com/albums/y5/AlexPuckett/Messupx2.jpg[/IMG]

  • The lines are pixelated

    I have been away from Adobe CSS for a while now, so I need a little help. I'm designing a logo, but having some problems creating nice faded lines. Also i cant move the little blue circle in the horses eye (guideline?). I hope that someone can tell me how to make the line less pixelated. Thank you very much.

    I suppose you do it in Illustrator. Did you have placed the file in InDesign because you are asking here?
    Did you have turned on the Display Performance on High Quality?
    If you have done the file in Illustrator and have used effects which will make a rasterized output how are your Document Raster Effects Settings (Effects) in Illustrator, and if so, how was the graphic scaled in InDesign?

  • IN A BATCH PROCESS TO SELECT A DIFFERENT LINE OF PIXELS?

    Hi there,
    I am trying to make my own slit scan image by selecting a single line of pixels from many frames.
    From the first frame I would like to select the first line of pixels. From the second frame I would like to select the second line of pixels and so on. Then for this process to repeat itself.
    It has been suggested that I can do this using the batch process in Photoshop however I cannot figure out how to do it!
    If there is a simplier way then please get in touch.
    Thanks
    Elena

    You should ask in the Photoshop forum.

  • How can i make line of pixels?

    i want to make a line of pixels to use it as a track so that i can make the train to animate right on it...if thier is any other way of doing so plz tell me...code needed

    How about java.awt.Graphic.drawLine?

  • Solid line of pixels in my warped gradient. Can anyone explain/help?

    Hello all,
    So this is very odd. Here's the breakdown and steps I've taken so far.
    I create a new layer and fill it with black. Then I make a new layer and make a marquee selection. Within the marquee selection, I fill the new layer with a color to transparent gradient fill. I then take the new gradient layer and warp it using the "FLAG" preset. I adjust the bend to 20% and commit the warp/transformation. I get the curve I want, but right in the middle of the curve, running straight up the layer, is a solid line of pixels. It's almost as if, that one little line missed out on both the gradient itself as well as the warp effect.
    Very odd indeed. Can anyone please explain what might be happening with that?
    Much appreciated.
    v/r
    Jake McCarthy

    Gerbert2001, I had tested in CS6 as the OP had not mentioned their version and could not reproduce the issue.
    But in Photoshop CC I also get offending results.
    parascopelv, you may want to post a bug report on the issue over at
    http://feedback.photoshop.com/photoshop_family/
    or see if one already exists.

  • BATCH PROCESS TO SELECT A DIFFERENT LINE OF PIXELS

    Hi there,
    I am trying to make my own slit scan image by selecting a single line of pixels from many frames.
    From the first frame I would like to select the first line of pixels. From the second frame I would like to select the second line of pixels and so on. Then for this process to repeat itself.
    It has been suggested that I can do this using the batch process in Photoshop however I cannot figure out how to do it!
    If there is a simplier way then please get in touch.
    Thanks
    Elena

    Hi,
    This is the Photoshop.com forum, which is the online forum for Photoshop.com web site.
    You'll get the best response if you post over in the below mentioned Photoshop forum:
    http://forums.adobe.com/community/photoshop
    Regards,
    Komal

  • How to move wax line down?

    Is it possble to move wax line down from an text adornment like it does "Paragraph Rules"->"Keep in frame"?

    Olemacr wrote:
    Thanks  for the reply but nothing happens on my iMac using those keys.
    There are global shortcuts, which should work in all apps; there are Cocoa text engine shortcuts, which should work in all apps which use the Cocoa text engine; and there are app shortcuts. How a specific app responds to a command such as Page Up is not necessarily under the OS control.
    The shortcuts indicated by Don Archibald are correct. How any specific app responds is another matter. So tell us exactly what app (and version) you are using and maybe we'll be able to help.
    I did find that on my MBP fn and up or down arrows did move a page at a time
    For some keys, and for obvious reasons, on the MBP fn is similar to control.

  • Can anyone recommend a moderate priced camcorder to use with I movie 08'...

    I recently purchased a i mac OSX version 10.5 and would like to buy a new camcorder. I would like recommendations for a good moderately priced camcorder to use with i movie 08 or i dvd. Thanks.

    Take a look at the Panasonic line of miniDV tape cams. Their better cams have 3CCD's, which is desirable.
    If you think you may wish to use iMovie 06, the earlier and, in the opinion of many iMovie faithful, the best iMovie version, you will require a miniDV tape cam with a Firewire port. Hard drive or DVD cams will not work with iMovie 06.
    If you choose a format other than miniDV, make sure the cam chosen is on Apple's compatibility list and be aware that even that is no guarantee of glitch free connection to your Mac, as can be seen in the iMovie 08 postings.
    Forest

  • I have itunes set up on a PC with all my music, apps, etc. I want to stop using PC and move my iTunes and files to a Mac I bought and synch my iPhone with the Mac. Can I just synch iPhone with Mac iTunes and will it copy all my stuff onto Mac, or will I h

    I have itunes set up on a PC with all my music, apps, etc. I want to stop using PC and move my iTunes and files to a Mac I bought and synch my iPhone with the Mac. Can I just synch iPhone with Mac iTunes and will it copy all my stuff onto Mac, or will I have to copy files from PC onto Mac?

    Here are some of the links to get you started.
    https://discussions.apple.com/thread/3727530?start=0&tstart=0
    http://support.apple.com/kb/HT4527
    http://www.macworld.com/article/1146958/move_itunes_windows_mac.html

  • Move Order lines and Delivery Detail lines - Relationship

    Hi All,
    Is there a one - to - one realtionship between Move Order Line and Delivery Detail Line?
    i.e., Each Move Order line will correspond to only one Delivery Details line Record?
    Thanks in advance.
    Regards,
    Gowri

    Hello,
    There is a one - to - many relationship between Move Order Line and Delivery Detail Line when you split lines in delivery.
    select * from mtl_material_transactions t you have source_id.
    select * from WSH_DELIVERABLES_v t you have move_order_id.
    Regards,
    Luko

  • How to add new line in transact move order line

    Hi,
    i am able to update locaotr in Transact move order.
    But i want to add two locators for the same line.
    I tried to insert one more record in data base, but getting error unique index error.
    so how can we add new line in transact move order line .
    please help to slove this isse.
    Thanks In Advance
    Venu.

    Hi,
    the fact that your question is posted in Order Management section, does the move order automatically generated by OM?
    nevertheless, i don't think you should (or allowed, in this case) to add a new line in transact move order. Transact move order only queries (not create records) the move order lines eligible to allocate and transact.
    So, I don't see why you need to add a new line in transact move order.
    You can, however, add a new line in the allocation of the lines, where for instance, you need to have half of the line allocated to one locator, and the other half to another locator
    Thanks

  • Error while using BAPI_GOODSMVT_CREATE wiht movement type 311.

    Hi All experts,
    i am geting error msg, while using BAPI_GOODSMVT_CREATE wiht movement type 311.
    the error msg is " For reservation 0000443815 0000, no movements can be posted".
    Here is my code.
    IF I_ZMM_S_MBIB_LOT[] IS NOT INITIAL.
    *moving posting date and document date  to header
        GOODSMVT_HEADER-PSTNG_DATE = ZMM_S_MBIB_311-BUDAT.
        GOODSMVT_HEADER-DOC_DATE   =  ZMM_S_MBIB_311-BUDAT.
        LOOP AT I_ZMM_S_MBIB_LOT WHERE MENGE NE '0'.
          IF I_ZMM_S_MBIB_LOT-IND = 'X'.
    *moving material and plant ,stge_loc,qty and movement type  to header
            GOODSMVT_ITEM-MATERIAL       = I_ZMM_S_MBIB_LOT-MATNR.
            GOODSMVT_ITEM-PLANT          = I_ZMM_S_MBIB_LOT-WERKS.
            GOODSMVT_ITEM-BATCH          =  I_ZMM_S_MBIB_LOT-CHARG.
            GOODSMVT_ITEM-STGE_LOC       = I_ZMM_S_MBIB_LOT-SLGORT.
            GOODSMVT_ITEM-MOVE_TYPE      = '311'.
            GOODSMVT_ITEM-ENTRY_QNT      = I_ZMM_S_MBIB_LOT-MENGE.
            GOODSMVT_ITEM-ENTRY_UOM      = I_ZMM_S_MBIB_LOT-MEINS.
            GOODSMVT_ITEM-MOVE_MAT       = I_ZMM_S_MBIB_LOT-MATNR.
            GOODSMVT_ITEM-MOVE_PLANT     = I_ZMM_S_MBIB_LOT-RWERKS.
            GOODSMVT_ITEM-MOVE_BATCH     = I_ZMM_S_MBIB_LOT-UMCHA.
            GOODSMVT_ITEM-MOVE_STLOC     = I_ZMM_S_MBIB_LOT-UMLGO.
            GOODSMVT_ITEM-RESERV_NO      = I_ZMM_S_MBIB_LOT-RSNUM.
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
            EXPORTING
              GOODSMVT_HEADER               = GOODSMVT_HEADER
              GOODSMVT_CODE                 = '04'
          TESTRUN                       = ' '
          GOODSMVT_REF_EWM              =
            IMPORTING
          GOODSMVT_HEADRET              =
              MATERIALDOCUMENT              = MATERIALDOCUMENT
              MATDOCUMENTYEAR               = MATDOCUMENTYEAR
            TABLES
              GOODSMVT_ITEM                 = GOODSMVT_ITEM
          GOODSMVT_SERIALNUMBER         =
              RETURN                        = RETURN.
          GOODSMVT_SERV_PART_DATA       =
          EXTENSIONIN                   =
        ELSE.
    Moderator message: duplicate post locked.
    Edited by: Thomas Zloch on Feb 23, 2011 11:46 AM

    Hi Sachin,
    Pass the Item Number of Reservation to GOODSMVT_ITEM-RES_ITEM .
    Regards
    DKS

  • No sound when using Airplay for Movies on Apple TV

    For reasons unknow, when I try to stream full length movies (Lion King and Nemo bought from iTunes) from my iPhone or Macbook Pro using Airplay, there is no sound.  When I stream smaller movies, like Boundin' the Pixar Short, there is no problem.
    Side note 1: Why do purchased movies not show up like purchased TV shows on Apple TV?  I feel like I shouldn't have to use Airplay for movies if I don't need to use it for TV shows I buy.
    Side note 2: For some Netflix movies played directly from Apple TV there is no sound.  Other movies work fine and the movies that work or don't work seem to change day to day.
    Thanks for your help.

    Gldsndz wrote:
    Side note 1: Why do purchased movies not show up like purchased TV shows on Apple TV?  I feel like I shouldn't have to use Airplay for movies if I don't need to use it for TV shows I buy.
    Apple has not negotiated the rights to allow this is the assumed reason.
    We can't even play Purchased music or TV Shows from the cloud in UK.

Maybe you are looking for