Drag and Drop (re-order) Thumbnails in Organizer

I am using Photoshop Elements version 5.0.2
I would like to re-order pictures in an order that will make sense for me in my business. I suppose I can go through each pix and change the time on them, so I can then sort by time stamp.
Is there an easier way to do this? I was hopeful that I could drag and drop them in Thumbnail view - but I cannot.
Thank you,
Jamie

>Is there anyway to delete the photos in the main well, without losing them from my collection?
As I understand the design, the main well is intended to be all the photos that you are managing with Photoshop Elements.
Collections are used to display a specific group of those photos in your chosen sequence for any given activity.
I suspect that since you are using a consumer product such as Photoshop Elements for your business purpose, you may need to make some compromises like having a default (the main photo well) display sequence which you see first when starting PSE that is not what you would choose.
This is not bad if PSE does what you want - just additional steps to switch to the Collection view and also to maintain (drag and drop) the sequencing of the collection when you add additional photo files to a Collection.

Similar Messages

  • JQuery drag and drop image order with save to database?

    We have a property image gallery on our website and a CMS that allows us to add/edit images in the gallery.
    Image file names are stored in a database table:
    imgID (int)
    propertyID (int)
    imgfilename (nvarchar)
    displayorder (int)
    Images are displayed in order of "displayorder" but we'd like to be able to drag and drop the order in our CMS and have this update the database table with the correct display order.
    We found this jQuery solution but it doesn't appear to work, although descriptively it's exactly what we're trying to acheive:
    http://halnesbitt.com/blog/2010/08/05/save-order-with-jquery-ui-sortable-and-aspaccess
    Can anyone advise a similar script or solution?  We're using Classic ASP and MSSQL.
    Thank you.
    NJ

    Hi,
    Not looking at any code you have an upload button for the video and an insert for the form. So both forms are independent of each other it looks like, thats why when you do one you only get that info and when you do the other you only get the other info. You should just make one form with the uploader included. Make one form with all the fields included (movie name, movie page, movie description, movie file) after the form is completed then select the file field and go to...
    Server Behaivoirs, Developer Toolbox, File upload, upload file. Follow the widgets.

  • Can't import photos via drag-and-drop (only small thumbnail will appear)

    After I drag and drop photos into iPhoto 7.1.3 (even a photo just exported from iPhoto), it shows the import process and creates an untitled event. Once complete, I see a dashed-line box instead of the images.
    http://idisk.mac.com/phildame/Public/Pictures/Skitch/iPhoto-20080308-111415.jpg
    Every time I re-open, it will try and re-import the failed photos, creating a new event each time. I have to tell it not to try recoving.
    Note that in the event view, it's a blank square. If a reduce the thumbnail slider enough the images appear in "Photos" view (as if only the small thumbnails were generated before it crapped out).
    Is anyone else seeing this? I'm not sure what to do.
    Phil

    Phil
    Two issues there:
    Every time I re-open, it will try and re-import the failed photos,...
    Go to your Pictures Folder and find the iPhoto Library there. Right (or Control-) Click on the icon and select 'Show Package Contents'. A finder window will open with the Library exposed.
    Look there for a Folder called 'Import' or 'Importing'.
    Drag it to the Desktop. *Make no other changes*.
    Start iPhoto. Does that help?
    2. As to the blank thumbnails:
    Back Up and try rebuild the library: hold down the apple and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild.
    Regards
    TD

  • Drag and Drop fails with JDK 7u6 in Linux

    Hi,
    I'm face with a strange bug on JavaFX 2.2 (JDK 7u6, Ubuntu 12); I implemented drag & drop feature of labels in a stage; first time, I open the stage, the drag & drop works well; when I close the stage and reopen it, it fails : I can drag the label but I cannot drop it on the target (the target events are not fired); I can reproduce the bug easily with the class below, you have just to instantiate the class TestDragAndDrop in an application class.
    On window 7, it works well, I cannot reproduce the bug.
    Thank you for your help,
    David
    public class TestDragAndDrop {
        public TestDragAndDrop() {
            Stage stage = new Stage();
            stage.setTitle("Hello Drag And Drop");
            Group root = new Group();
            Scene scene = new Scene(root, 400, 200);
            scene.setFill(Color.LIGHTGREEN);
            final Text source = new Text(50, 100, "DRAG ME");
            source.setScaleX(2.0);
            source.setScaleY(2.0);
            final Text target = new Text(250, 100, "DROP HERE");
            target.setScaleX(2.0);
            target.setScaleY(2.0);
            source.setOnDragDetected(new EventHandler <MouseEvent>() {
                public void handle(MouseEvent event) {
                    /* drag was detected, start drag-and-drop gesture*/
                    System.out.println("onDragDetected");
                    /* allow any transfer mode */
                    Dragboard db = source.startDragAndDrop(TransferMode.ANY);
                    /* put a string on dragboard */
                    ClipboardContent content = new ClipboardContent();
                    content.putString(source.getText());
                    db.setContent(content);
                    event.consume();
            target.setOnDragOver(new EventHandler <DragEvent>() {
                public void handle(DragEvent event) {
                    /* data is dragged over the target */
                    System.out.println("onDragOver");
                    /* accept it only if it is  not dragged from the same node
                     * and if it has a string data */
                    if (event.getGestureSource() != target &&
                            event.getDragboard().hasString()) {
                        /* allow for both copying and moving, whatever user chooses */
                        event.acceptTransferModes(TransferMode.COPY_OR_MOVE);
                    event.consume();
            target.setOnDragEntered(new EventHandler <DragEvent>() {
                public void handle(DragEvent event) {
                    /* the drag-and-drop gesture entered the target */
                    System.out.println("onDragEntered");
                    /* show to the user that it is an actual gesture target */
                    if (event.getGestureSource() != target &&
                            event.getDragboard().hasString()) {
                        target.setFill(Color.GREEN);
                    event.consume();
            target.setOnDragExited(new EventHandler <DragEvent>() {
                public void handle(DragEvent event) {
                    /* mouse moved away, remove the graphical cues */
                    target.setFill(Color.BLACK);
                    event.consume();
            target.setOnDragDropped(new EventHandler <DragEvent>() {
                public void handle(DragEvent event) {
                    /* data dropped */
                    System.out.println("onDragDropped");
                    /* if there is a string data on dragboard, read it and use it */
                    Dragboard db = event.getDragboard();
                    boolean success = false;
                    if (db.hasString()) {
                        target.setText(db.getString());
                        success = true;
                    /* let the source know whether the string was successfully
                     * transferred and used */
                    event.setDropCompleted(success);
                    event.consume();
            source.setOnDragDone(new EventHandler <DragEvent>() {
                public void handle(DragEvent event) {
                    /* the drag-and-drop gesture ended */
                    System.out.println("onDragDone");
                    /* if the data was successfully moved, clear it */
                    if (event.getTransferMode() == TransferMode.MOVE) {
                        source.setText("");
                    event.consume();
            root.getChildren().add(source);
            root.getChildren().add(target);
            stage.setScene(scene);
            stage.show();
        public static void main(String[] args) {
            Application.launch(args);

    DUUUUUUUDE! IT'S WORKING NOW!!!!
    When you originally asked, "What happens if you click on an image and move it to another folder?", I didn't really understand what you were talking about because I almost never have my workspace set up in a way that the folders are showing. I always hide them. So I didn't really understand what you were saying. Just a few minutes ago, I realized that that is what you were asking so I opened up the folder area and tried dragging thumbs into different folders and saw that it does work.
    So then, because of you mentioning that blue line and me know that I did see the blue line on occasion. I went back over into the thumbnails to find out if I always got the blue line or if it was a hit or miss thing. I couldn't believe my eyes when all of the sudden I saw that I no longer was getting that circle with the line through it, and low and behold, the thumbnail dropped right into position like it is supposed to!!!!
    The thing is, I don't know what I've learned from this. I thought, "well, what is different?" The only thing that I can think of is that I now have the folders showing in my workspace so I wondered if that was the secret but I just now hid the folders again like I usually do and the drag and drop into position is STILL WORKING!!!
    All I can figure is that somehow, dragging and dropping a thumbnail into a folder like that for the first time, triggered something so that I can now drag and drop among the thumbnail positions? Not sure. All I know is that for some reason, IT'S WORKING NOW!
    Now, for the second important part, I wonder if I drag and drop everything into the order that I want and then select all of the files and drag them into a new folder, will they stay in that order? I need to go experiment with that.
    If you hadn't kept at it and in turn had me keep trying stuff, it would have never happened because I had pretty much given up.
    Thanks Curt!
    You da man!!!

  • Unable to drag and drop images with manual sort in CS2 bridge

    I've had CS2 for several years now but for some reason, just never really needed to do a manual sort. Now that I DO need to, it doesn't seem to be working. I have the view set for manual and no matter what kind of working space I use, the program does not allow me to drag and drop the thumbnails into different positions. All I get is that circle with a diagonal line through it, showing me that what I'm trying isn't going to work.
    Any ideas?
    Windows XP
    2G of ram
    Bridge version 1.0.4.6 (104504)
    CS2

    DUUUUUUUDE! IT'S WORKING NOW!!!!
    When you originally asked, "What happens if you click on an image and move it to another folder?", I didn't really understand what you were talking about because I almost never have my workspace set up in a way that the folders are showing. I always hide them. So I didn't really understand what you were saying. Just a few minutes ago, I realized that that is what you were asking so I opened up the folder area and tried dragging thumbs into different folders and saw that it does work.
    So then, because of you mentioning that blue line and me know that I did see the blue line on occasion. I went back over into the thumbnails to find out if I always got the blue line or if it was a hit or miss thing. I couldn't believe my eyes when all of the sudden I saw that I no longer was getting that circle with the line through it, and low and behold, the thumbnail dropped right into position like it is supposed to!!!!
    The thing is, I don't know what I've learned from this. I thought, "well, what is different?" The only thing that I can think of is that I now have the folders showing in my workspace so I wondered if that was the secret but I just now hid the folders again like I usually do and the drag and drop into position is STILL WORKING!!!
    All I can figure is that somehow, dragging and dropping a thumbnail into a folder like that for the first time, triggered something so that I can now drag and drop among the thumbnail positions? Not sure. All I know is that for some reason, IT'S WORKING NOW!
    Now, for the second important part, I wonder if I drag and drop everything into the order that I want and then select all of the files and drag them into a new folder, will they stay in that order? I need to go experiment with that.
    If you hadn't kept at it and in turn had me keep trying stuff, it would have never happened because I had pretty much given up.
    Thanks Curt!
    You da man!!!

  • How do I set up my drag and drop questionaire to export to a XML file?

    How do I set up my drag and drop questionaire to export to a
    XML file?
    I have a 70 seperate SWF files that pose a question and
    contain a drag and drop rank order response of 1,2,3,4.How do I set
    up a XML file that receives the responses.I don't understand how to
    do the Actionscript
    and get my responses to connect to the XML.Please
    Help!Thanks!
    Here's an example of my XML.
    <assessment>
    <sessionid>ffae926ea290ee93c3f26669c6c04a92</sessionid>
    <request>save_progress</request>
    <question>
    <number>1</number>
    <slot_a>2</slot_a>
    <slot_b>1</slot_b>
    <slot_c>4</slot_c>
    <slot_d>3</slot_d>
    </question>
    <question>
    <number>2</number>
    <slot_a>4</slot_a>
    <slot_b>3</slot_b>
    <slot_c>2</slot_c>
    <slot_d>1</slot_d>
    </question>
    <question>
    <number>3</number>
    <slot_a>1</slot_a>
    <slot_b>2</slot_b>
    <slot_c>3</slot_c>
    <slot_d>4</slot_d>
    </question>
    </assessment>

    Use XML.sendAndLoad.
    http://livedocs.macromedia.com/flash/8/main/00002879.html
    You will need a server script to receive the XML structure
    and it depends on
    the server scripting language how you obtain that data. Then
    you can either
    populate a database or write to a static file or even email
    the XML data
    received from Flash.
    For a basic example, I have two links I use for students in
    my Flash
    courses:
    http://www.hosfordusa.com/ClickSystems/courses/flash/examples/XMLASP/Ex01/XMLASPEchoEx01_D oc.php
    http://www.hosfordusa.com/ClickSystems/courses/flash/examples/XMLPHP/EX01/XMLPHPEchoEx01_D oc.php
    Lon Hosford
    www.lonhosford.com
    May many happy bits flow your way!
    "kenpoian" <[email protected]> wrote in
    message
    news:e5i9hp$cs6$[email protected]..
    How do I set up my drag and drop questionaire to export to a
    XML file?
    I have a 70 seperate SWF files that pose a question and
    contain a drag and
    drop rank order response of 1,2,3,4.How do I set up a XML
    file that receives
    the responses.I don't understand how to do the Actionscript
    and get my responses to connect to the XML.Please
    Help!Thanks!
    Here's an example of my XML.
    <assessment>
    <sessionid>ffae926ea290ee93c3f26669c6c04a92</sessionid>
    <request>save_progress</request>
    <question>
    <number>1</number>
    <slot_a>2</slot_a>
    <slot_b>1</slot_b>
    <slot_c>4</slot_c>
    <slot_d>3</slot_d>
    </question>
    <question>
    <number>2</number>
    <slot_a>4</slot_a>
    <slot_b>3</slot_b>
    <slot_c>2</slot_c>
    <slot_d>1</slot_d>
    </question>
    <question>
    <number>3</number>
    <slot_a>1</slot_a>
    <slot_b>2</slot_b>
    <slot_c>3</slot_c>
    <slot_d>4</slot_d>
    </question>
    </assessment>

  • Drag and Drop from a screen device (:0.0) to another (:0.1)

    Hello,
    Working with JDK 1.4 I have used the drag and drop in order to drag objects from a JFrame displayed in the logical screen :0.0 to another one, working in the same JVM, but displayed in the logical screen :0.1. This work fine.
    Now, I'm usin the JDK 1.5. With the same code, the drag operation does not work. During the drag operation, I can not move the mouse from one screen to another. The mouse is "blocked" in the source logical screen. The same code works with the JDK1.4 ? I have searched in the forum and I don't find any post on that subject ?
    The drag and drop is not compliant with the JDk 1.4 ? What can I do to resolve this problem ?
    Thanks you for yours answers !!
    Bruno

    I have change my drag and drop implementation. The old one uses the DragGestureListener. Now, I just use the TransfertHandler.
    The result in exactly the same : When the mouse reach the screen border, you can not move it to the other screen...
    Can someone try whith its application ?
    Have someone have a solution.... It is very important for my project.
    Thanks a lot !
    Bruno

  • Organizer Drag and Drop Issue

    In PSE4 I am in Folder Location view working in Folder A. I drag and drop a few files to Folder B. Unfortunately now PSE puts me in Folder B. "I" didn't want to go to Folder B, I just wanted to put some files there. Other programs don't change the focus to the new folder. How can I get PSE4 not to do that?
    Thanks for any help.
    Dale

    Colin is right, but I have also been very frustrated by the behavior you mention, Michael. Thanks for that tip.
    Here is the weirdest thing. I am in Folder Location view and I have selected Folder 20070501 in the lefthand pane. On the right hand pane a band shows with that name followed by only one of the 97 pictures in the folder. Then comes a band by the name of the next directory and instead of showing any of the pictures actually in that directory, it shows a couple of pictures that are actually in the 2007501 directory. And so on it continues. Finally, the next directory in order is listed followed by the pictures actually in the 20070501 directory. It is nothing short of bizarre.
    HOWEVER, when I did what you suggested, Michael, everything was as it should be when I came back. So this seems to be just another variation of what you mentioned.
    Colin, you said you don't use Folder View much. Granted you can have pictures located anywhere and organize them with PSE4 but I've found for when I'm in Win Explorer and need to see something that having them organized by folders is helpful for me. Have either of you found a process for managing pictures that works well for you, because I'm still looking for the best way to do it including when to remove pictures from my hard drive.
    Dale

  • Why cant I drag and drop my pictures into an order I want to display them

    Why can't I drag and drop my pictures into an order that I want to display them ? The 'manual sort' option does not seem to be 'lit' nor does the 'reset manual sort' what am I doing wrong please.
    ps
    Beginning to wish I had stuck with a PC !

    If you prefer a PC use it. No one here cares one bit
    As to iPhoto, unless you take a few minutes to actually learn how to use it then you will never be happy. Same with any new PC program that you do not understand. Or a new car for that matter
    A great place to start your education is here. http://www.apple.com/support/iphoto/
    As to your specific issue, trivial. Make an album of the photos and manually drag them to the order you want. Events simply do not work that way
    Try to drive your car in Park and you get nowhere because that is not how it works. Any time you use a product incorrectly you will have poor results
    LN

  • Drag and drop to T/L, dragging vid with aud, no thumbnails, other errati

    Here's my first post, from my first Mac, on this forum in this great Apple world...
    I'm working through Diana Weynand's FCP6 training book and have the following oddities:
    1-drag and drop from the Browser to the timeline does not work. I can drag from the Viewer to the T/L, just not from Browser. Also, double clicking in the Browser no longer loads the clip into the Viewer...which it did the first couple hours.
    2-working in the Timeline, I drag a video clip, but it's corresponding audio clip stays behind. Is there a way to link them, or should I use a different tool than the Select arrow?
    3-No thumbnails either in the Browser or on the T/L, just a plus sign. No message about Offline or similar. Is Reconnecting the best remedy?
    Also, MBP questions.
    Is there no way to delete Right of the cursor, only the Delete key, moving Left?
    How do I access/activate the NumPad key functions?--I could use a link to an MBP keyboard function tutorial.
    Is there any driver or plugin to simulate a mousewheel on the touchpad? I miss it for zooming. This is a 1yr old 17" MBP with C2D 2.4GHz SantaRosa...
    thanks,
    Scott

    Hello,
    I am also trying to do drag and drop into a JTextArea, as well as selecting and dragging text around in the JTextArea.
    Would you please be kind enough to show me some source code that does this, or at least point me in the direction of some useful links that might help me?
    My email is [email protected]
    Thanks in advance!
    Andrea

  • Drag and Drop to Change Order of a Collection

    I have created a collection and now want to change the order of the photos in the collection. I try to select a photo to drag and drop it to the correct position.
    Sometimes I can do this, other times I can't.
    If I exit and reenter Lightroom, the problem of not being able to drag and drop is corrected.
    Any ideas about a workaround for this bug without exiting and restarting Lightroom?
    Thanks,
    Harry

    Harry,
    You have to be at the lowest level of a folder/collection to get drag and drop to work.
    If you have 'Include Photos from Subitems' unticked then you can sort in higher up folders/collections, but this only shows items in the actual collection/folder.
    If you have images in multiple collections that you want to sort in order, select them and then Ctrl N (Cmd N on Mac ) to create a new collection. Tick the use selected photos box and name the new collection. Make sure it's at the bottom of a collection tree (or on it's own) and then sort inside the new collection.
    When dragging, drag from the image itself, not from the border around it.

  • Drag and Drop to Change Order in a List

    Does anyone know of an example where there is the ability to drag and drop elements in a list and thus change their order? (I.E. drag item one below item two and then item one and two change locations)
    Thanks!

    Check out http://java.sun.com/docs/books/tutorial/uiswing/misc/dnd.html
    There's an example towards the end of the page for drag-and-drop between 2 JLists. Might be a good starting point.

  • Drag and drop songs in order?

    I want to organise the order of songs in a playlist but can't seem to drag and drop anymore since updating?

    I can still drag and drop - from within the playlist.

  • Drag and Drop in Organizer

    I am new to Premiere and am trying to add media to an existing project. It appears that I should be able to do that from the Organizer. From what I have been reading I should be able to just drag and drop media within organizer to the premiere project. However when I drag any media over top of any project a circle with a cross through it comes up indicating that I can't. Is this not possible from within the Organizer?

    You are probably dropping the media at wrong place in PrE. You need to drag the media from Organizer into the Media(Project->Media) Panel of PrE first.
    Then you can use the media in PrE.
    Other way is right click your media in Organizer and select 'Edit with Premiere Elements', this will import the media in PrE and also add it to the last of the timeline.

  • Using MouseMotionListener in order to have a drag and drop effect

    Hello,
    How is the exact syntax in order for the following code to work even for Drag and Drop effects of the drawn figures.
    package tpi;
    import java.awt.*;
    import java.awt.event.*;
    public class Desenare extends Frame{
         private Panel selPanel;
         private Choice sel;
         private Choice fond;
         private Choice lista;
         private MyCanvas canvas;
         public Desenare(String titlu){
              super(titlu);
              selPanel = new Panel(new GridLayout(6,1));
              Label label1 = new Label("Culoare");
              sel = new Choice();
              sel.addItem("Alb");
              sel.addItem("Albastru");
              sel.addItem("Verde");
              sel.addItem("Negru");
              sel.select(0);
              Label label2 = new Label("Figura");
              lista = new Choice();
              lista.addItem("Dreptunghi");
              lista.addItem("Linie");
              lista.addItem("Cerc");
              lista.select(0);
              Label label3 = new Label("Culoare Fond");
              fond = new Choice();
              fond.addItem("Negru");
              fond.addItem("Verde");
              fond.addItem("Albastru");
              fond.addItem("Alb");
              fond.select(0);
              IL itemListener = new IL();
              sel.addItemListener(itemListener);
              fond.addItemListener(itemListener);
              lista.addItemListener(itemListener);
              selPanel.add(label1);
              selPanel.add(sel);
              selPanel.add(label2);
              selPanel.add(lista);
              selPanel.add(label3);
              selPanel.add(fond);
              selPanel.setBackground(Color.LIGHT_GRAY);
              canvas = new MyCanvas();
              add("West",selPanel);
              add("Center",canvas);
              addWindowListener(new WA());
              setSize(400,300);
              setVisible(true);
         class WA extends WindowAdapter{
              public void windowClosing(WindowEvent e){
                   System.exit(0);
         class IL implements ItemListener{
              public void itemStateChanged(ItemEvent event){
              canvas.repaint();
         Color genCuloare(String culoare){
              Color color;
              if (culoare.equals("Negru")) color = Color.black;
              else if (culoare.equals("Verde")) color = Color.green;
              else if (culoare.equals("Albastru")) color = Color.blue;
              else if (culoare.equals("Alb")) color = Color.white;
              else color = Color.black;
              return color;
         class MyCanvas extends Canvas{
              public void paint(Graphics g){
              String culoare = sel.getSelectedItem();
              Color color = genCuloare(culoare);
              g.setColor(color);
              color = genCuloare(fond.getSelectedItem());
              setBackground(color);
              Dimension dim = getSize();
              int cx = dim.width/2;
              int cy = dim.height/2;
              String figura = lista.getSelectedItem();
              if (figura.equals("Linie"))
              g.drawLine(cx/2,cy/2,3*cx/2,3*cy/2);
              else if (figura.equals("Dreptunghi"))
              g.fillRect(cx/2,cy/2,cx,cy);
              else if (figura.equals("Cerc"))
              g.fillOval(cx/2,cy/2,cx,cy);
              ML listener = new ML();
              canvas.addMouseMotionListener(listener);
              public class ML implements MouseMotionListener{
                   @Override
                   public void mouseDragged(MouseEvent arg0) {
                        // TODO Auto-generated method stub
                   @Override
                   public void mouseMoved(MouseEvent arg0) {
                        // TODO Auto-generated method stub
              public static void main(String []args){
              Desenare d = new Desenare("Desenare 2D");
    Where exactly do i have to add the MouseMotionListener , i guess that i should add it to the canvas , and the inherited metod shoul be modified in order to use canvas.repaint() at the location where the draggin effect has ended, or if there is some other way when i press the mouse on the figure and start moving around to getX() and getY() and use the repaint method at those coordinates , wich is a drag and drop effect , i think that it would be MouseMoved , but i`m not sure, and also not sure how to use the Event Listener , where exactly ?
    Thanks,
    Paul

    When you post a code, use code tags for propere formatting. Click CODE icon on the taskbar for generating code tag pair you need.
    In order to do dragging the figure on the canvas or panel, you should use advanced Java 2D APIs, including Shape and its descendants. Example shown below might help, but beware, this version does not remember previous drag result for a figure over multiple lista Choice selection. Previous drag result is reset for the next selection of the same figure.
    If you want to prevent flickering on the screen while dragging, use javax.swing and its components. If you have to use AWT, draw the figure into an Image or BufferedImage of full panel size and call g2.drawImage() in the paint() method.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.event.*;
    public class Desenare extends Frame{
      private Panel selPanel;
      private Choice sel;
      private Choice fond;
      private Choice lista;
      private MyCanvas canvas;
      Color fcolor, bcolor;
      enum Fig{LINE, RECT, CIRCLE};
      Fig fig;
      int xL0, yL0, xL1, yL1;
      int xR0, yR0, xR1, yR1;
      int xC0, yC0, xC1, yC1;
      int dxL, dyL, dxR, dyR, dxC, dyC;
      Shape shape;
      public Desenare(String titlu){
        super(titlu);
        selPanel = new Panel(new GridLayout(6,1));
        fcolor = bcolor = Color.white;
        dxL = dyL = dxR = dyR = dxC = dyC = 0;
        Label label1 = new Label("Culoare");
        sel = new Choice();
        sel.addItem("Alb");
        sel.addItem("Albastru");
        sel.addItem("Verde");
        sel.addItem("Negru");
        sel.select(0);
        Label label2 = new Label("Figura");
        lista = new Choice();
        lista.addItem("Dreptunghi");
        lista.addItem("Linie");
        lista.addItem("Cerc");
        lista.select(0);
        Label label3 = new Label("Culoare Fond");
        fond = new Choice();
        fond.addItem("Alb");
        fond.addItem("Albastru");
        fond.addItem("Verde");
        fond.addItem("Negru");
        fond.select(0);
        IL itemListener = new IL();
        sel.addItemListener(itemListener);
        fond.addItemListener(itemListener);
        lista.addItemListener(itemListener);
        selPanel.add(label1);
        selPanel.add(sel);
        selPanel.add(label2);
        selPanel.add(lista);
        selPanel.add(label3);
        selPanel.add(fond);
        selPanel.setBackground(Color.LIGHT_GRAY);
        canvas = new MyCanvas();
        add(selPanel, BorderLayout.WEST);
        add(canvas, BorderLayout.CENTER);
        addWindowListener(new WA());
        setSize(400, 300);
        setVisible(true);
      class WA extends WindowAdapter{
        public void windowClosing(WindowEvent e){
          System.exit(0);
      class IL implements ItemListener{
        public void itemStateChanged(ItemEvent event){
          Object o = event.getSource();
          if (o == sel){
            String culoare = sel.getSelectedItem();
            fcolor = genCuloare(culoare);
            canvas.repaint();
          else if (o == fond){
            bcolor = genCuloare(fond.getSelectedItem());
            canvas.setBackground(bcolor);
          else if (o == lista){
            String figura = lista.getSelectedItem();
            if (figura.equals("Linie")){
              fig = Fig.LINE;
            else if (figura.equals("Dreptunghi")){
              fig = Fig.RECT;
            else if (figura.equals("Cerc")){
              fig = Fig.CIRCLE;
            shape = prepareShape(fig);
            canvas.repaint();
      Shape prepareShape(Fig fig){
        Shape shape = null;
        if (fig == Fig.LINE){
          shape = new Line2D.Float(xL0, yL0, xL1, yL1);
        else if (fig == Fig.RECT){
          shape = new Rectangle2D.Float(xR0, yR0, xR1, yR1);
        else if (fig == Fig.CIRCLE){
          shape = new Ellipse2D.Float(xC0, yC0, xC1, yC1);
        return shape;
      Shape prepareShapeDrag(Fig fig){
        Shape shape = null;
        if (fig == Fig.LINE){
          shape = new Line2D.Float(xL0 + dxL, yL0 + dyL, xL1 + dxL, yL1 + dyL);
        else if (fig == Fig.RECT){
          shape = new Rectangle2D.Float(xR0 + dxR, yR0 + dyR, xR1, yR1);
        else if (fig == Fig.CIRCLE){
          shape = new Ellipse2D.Float(xC0 + dxC, yC0 + dyC, xC1, yC1);
        return shape;
      Color genCuloare(String culoare){
        Color color;
        if (culoare.equals("Negru")){
          color = Color.black;
        else if (culoare.equals("Verde")){
          color = Color.green;
        else if (culoare.equals("Albastru")){
          color = Color.blue;
        else if (culoare.equals("Alb")){
          color = Color.white;
        else{
          color = Color.black;
        return color;
      class MyCanvas extends Canvas{
        public MyCanvas(){
          setBackground(Color.white);
          ML ml = new ML();
          addMouseListener(ml);
          addMouseMotionListener(ml);
        public void paint(Graphics g){
          Graphics2D g2 = (Graphics2D)g;
          setCoords();
          g2.setPaint(fcolor);
          if (shape != null){
            g2.draw(shape);
            g2.fill(shape);
        void setCoords(){
          int w = getWidth();
          int h = getHeight();
          xL0 = w / 4;
          yL0 = h / 4;
          xL1 = xL0 * 3;
          yL1 = yL0 * 3;
          xC0 = xR0 = xL0;
          yC0 = yR0 = yL0;
          xC1 = xR1 = w / 2;
          yC1 = yR1 = h / 2;
      public class ML extends MouseInputAdapter{
        Shape s = null;
        Point p0 = null;
        Point p1 = null;
        @Override
        public void mousePressed(MouseEvent e) {
          double dist = 0.0;
          p0 = p1 = e.getPoint();
          if (shape instanceof Line2D){
            dist = ((Line2D)shape).ptSegDist(p0);
            if (dist < 2){
              s = shape;
            else{
              s = null;
          else{
            if (shape.contains(p0)){
              s = shape;
            else{
              s = null;
        @Override
        public void mouseDragged(MouseEvent e) {
          int dx, dy;
          if (s != null){
            p0 = p1;
            p1 = e.getPoint();
            dx = p1.x - p0.x;
            dy = p1.y - p0.y;
            if (s instanceof Line2D){
              dxL += dx;
              dyL += dy;
            else if (s instanceof Rectangle2D){
              dxR += dx;
              dyR += dy;
            else if (s instanceof Ellipse2D){
              dxC += dx;
              dyC += dy;
            shape = Desenare.this.prepareShapeDrag(fig);
            canvas.repaint();
      public static void main(String []args){
        Desenare d = new Desenare("Desenare 2D with Dragging support");
    }

Maybe you are looking for

  • Exit out of video and return to stage frame 1

    Ive manged to create a flash player that incorporates a video using a online tutorial with the code below. All is working well but at the end of the video I want to exit out of the video and return to the stage at frame 1. The reason being is; before

  • How to delete particular row in ALV list display

    Hi All, My requirement is : I am displaying ouput using lav list dispplay befor the first colomn i am displaying check box. i defined my own pf status here . in pf status i have 3 buttons . 1 select all 2 deselect all 3 delete. First two options are

  • Variable used in FOx formula should get value from user

    Hi Gurus, In my fox formula I want to multiply a keyfigure (say quantity) with a factor. For example if the factor is 10 then all records should get multiplied by 10. But the requirement is user shpuld be able to give the factor that should be multip

  • Ipad and iphone will not sync with a new Lenovo laptop

    My iphone and ipad synced contacts with a wire flawlessly until I changed to a new PC.  I work for Oracle so I cannot config to use iCloud.  I checked the Library Persistent ID on the new laptop and it is the same as the old one.  Do I need to wipe m

  • Installing FCS2 without upgrading FCP 5.1

    I just got Final Cut Studio 2 and want to install it without upgrading Final Cut Pro. I'm still on FCP 5.1 at work and want to stay easily compatible on my laptop, is this possible?