Need Help In Moving An Item

Hi Guys,
I am trying to move an item in a list upward but it is not working the way i want. The element that i select still remains after it has swapped position with the previous elements. I am using Jlist .
listTasks is a JLIst
and
listModel is ListModel
For instance if i have
1
2as a list, after i select 2 and click the up button i get
2
1
2This is the code snippet :
public void mouseClicked(MouseEvent e) {
          int id = 0;
          if(e.getSource() == this.lblUpArrow){
               id = this.listTasks.getSelectedIndex();
               if((id > 0 ) && (this.listModel.size() != 0)){
                    Object value = this.listModel.getElementAt(id);
                    Object previousValue = this.listModel.getElementAt(id - 1);
                    this.listModel.insertElementAt(value.toString(), (id - 1));
                    this.listTasks.remove(id);
                    this.listModel.insertElementAt(previousValue.toString(), (id));
                    this.listModel.remove(id + 1);
     }thanks for your help.

kap wrote:
Hi Guys,
I am trying to move an item in a list upward but it is not working the way i want. The element that i select still remains after it has swapped position with the previous elements. I am using Jlist .
listTasks is a JLIst
and
listModel is ListModel
For instance if i have
1
2as a list, after i select 2 and click the up button i get
2
1
2This is the code snippet :
public void mouseClicked(MouseEvent e) {
          int id = 0;
          if(e.getSource() == this.lblUpArrow){
               id = this.listTasks.getSelectedIndex();
               if((id > 0 ) && (this.listModel.size() != 0)){
                    Object value = this.listModel.getElementAt(id);
                    Object previousValue = this.listModel.getElementAt(id - 1);
                    this.listModel.insertElementAt(value.toString(), (id - 1));
                    this.listTasks.remove(id);
                    this.listModel.insertElementAt(previousValue.toString(), (id));
                    this.listModel.remove(id + 1);
     }thanks for your help.Try to move the item ONLY in lisModel and repaint JList

Similar Messages

  • Needing help with moving pictures around

    I am in need of help in moving pictures and images around
    dreamweaver document window. My older brother gave me his computer
    witch has dreamweaver MX (he is in Irag) so i can start building
    building my own websites. I went to borders and bought a book on
    dreamweaver MX. Here is where I am having a problem with: when ever
    I bring a picture into the document window I can not move the
    picture around the document window. The book say "place the
    insertion point where you want the image to appear" but there is no
    insertion point. There is just a straight line as if I am about to
    type something. It's almost like I am in microsoft word. If I take
    the mouse over the picture , and then left click and try to drag
    the picture to the location I want it in, it doesn't move. Can
    somebody PLEASE help me out with this problem. Thanks Jical

    Nadia gave you a good place to start… Here is what you
    have to understand. Web pages are based on specific code that tells
    the viewer’s browser how to display the page. There has to be
    something that says, “Put this picture in the lower right
    hand corner, and center this image in the middle of the
    screen”
    Then there are further instructions that say “Put this
    text here and that link there”. So Dreamweaver (and most
    other web developing programs) do not work like Illustrator or
    PowerPoint where you can simply grab a picture and slide it around
    the page.
    In its simplest form you might drag an image onto the
    Dreamweaver design view page and click on the center button in the
    properties dialog.
    Then type in text and center it, left justify, right justify,
    etc. Add another picture and so on and you could possibly create a
    passable web page. Now click on the Code view button and see what
    code Dreamweaver generated in order to do all of this.
    That is what you will really need to understand before you
    can really get proficient at web design.
    At the next level, you can start to add in tables. These
    actually are similar to tables in Word. You can put text in one
    cell, images in another, colored backgrounds, thick and thin
    borders with contrasting colors, and you can start to see how to
    “contain” your images as Nadia suggests.
    Now look at the code again and see how these cells are
    defined around your content.
    Once you understand how this works, you will get much more
    comfortable with Dreamweaver. You will just have to get used to the
    idea that it doesn’t work like all of the publishing software
    that is only dependant upon its own format for layout. HTML is
    dependant upon the many browsers, computers, operating systems,
    user preferences, and a million other unknown factors.
    That’s why this forum has more than 91,000 posts…

  • Need help with moving items betwen 2 netui select boxes

    Hi,
    I have 2 multiple select boxes for possible courses and assigned courses. I need a way to implement move of option items from one box to another using buttons. The user can select courses from one box and move them to another. I am not sure how I would do that with netui select boxes and a pageflow method. If I use javascript, i get all kinds of errors even though I am trying to use the tagid. If validation fails, then the select boxes dont save the updated content.
    Please help.
    Bindu

    Ahmed_Arafa wrote:
    hii all,
    i have a list item.. in this list item i have a two list item value
    1- visa ,list elements visa
    2- cash ,list elements cash
    i need when user select visa from list item then appear text item (visa_number)
    i change item visa_number visible to no
    that's my code i write it
    trigger
    when new-block-instance
    IF :RESERVATION.PAY_METHOD = 'visa'THEN
         SET_ITEM_PROPERTY('RESERVATION.VISA_NUMBER',VISIBLE,PROPERTY_TRUE);
    ELSE
    SET_ITEM_PROPERTY('RESERVATION.VISA_NUMBER',VISIBLE,PROPERTY_FALSE);     
    END IF;**My problem is when i click on cash in the first nothing happen and this right
    when i click to visa second nothing happen this not right
    **when i click on visa first every thing is working
    i need when i click on visa any time item appear and when i would like to click to cash.. visa item is disappearWrite your code in When-List-Change trigger at list_item.
    Hope this will help you.

  • I need help with moving my iTunes library to a new disk...

    I'm soon gonna get a new SSD which is half the size of my HDD. So i guess i wont be able to restore with time machine or use disk utility to clone the drive. I'll have to start with a fresh copy of moutain lion.
    What I'll want to do is that keep all my music on my ssd and let all the podcast and itunes u be on an external hdd.
    can someone outline the steps to...
    create a library on the ssd on which os x is installed.
    move music, playlists and apps.
    let the podcast and itunes u be on an external hdd and yet be accessible from itunes, like being referenced.
    in the past i did this by moving the entire library to the internal drive and then while itunes was running, move the videos from the library folder to the external drive. it autoMAGICALLY was able to find the videos on the external drive while my music and apps were stored in the internal.
    now my library size is so big with all the videos that i cannot do the above steps as i want be able to copy the entire library to the internal ssd.
    any help is appreciated.
    thanks in addvace.
    Neerav

    Sometimes we sleep.  We have even been known to be away from the keybord to bathe (but usually not for longer than 2 minutes once a week ).
    I don't know how you automagically did it last time - your details are lacking.  iTunes is normally terrible at following you moving things, especially from drive to drive.  You either have to let iTunes do the moving (by consolidating to a new location) or you have to disable iTunes managing your media in which case it will follow moving inside a drive but still not between drives.
    Despite the new version, iTunes still does not make it easy to split your library between drives.  Probably since you only buy your items from iTunes and are never away from a high speed Internet connection it doesn't matter since you can always stream or download items you need from your Match subscription, right?
    Small hard drive? Split your iTunes library across multiple volumes - http://www.macyourself.com/2009/04/24/small-hard-drive-split-your-itunes-library -across-multiple-volumes/  - copying media folders to external, then deleting from internal, then adding again.
    Splitting & Managing Your iTunes Library - http://machintsandtips.com/i-j-k/itunes/splitting-managing-your-itunes-library/ - using option+drag to override iTunes from copying file to your default media folder.
    Dougscripts: Relocates selected files to a folder of your choice - http://dougscripts.com/itunes/scripts/ss.php?sp=relocateselected - replaces "Move Files To Folder"
    https://discussions.apple.com/message/10160819#10160819 - Change location of media folder to start putting files on second drive.  Note later follow-up post about leaving 'organize media' and 'copy to drive' checked.
    TuneSpan: (OS X app) A utility that allows you to distribute the media files in your iTunes Library across multiple drives. - http://tunespan.com/ - https://itunes.apple.com/us/app/tunespan/id528459889?mt=12 - Requirements: OS X 10.6.6 or later, 64-bit processor

  • Need help finding moved image files

    How would I find files after they have been moved? I travel and use a MB Pro laptop. The workflow I'm using is to download images to my desktop, review, rate and add keywords immediately. I make 2 backups, 1 to portable data store hard drive and one to DVD. Then every few days I erase the desktop image files. When I arrive home I download the entire trip's images from the portable storage to my desktop drives (2 500Gb SATA drives).
    Is there an easy way to direct Aperture to look for the files in the new location? Or, failing that, is there a better way to work? I regularly have 40 - 60 Gb of images after a trip and the laptop hard drive is inadequate for the task.

    The question isn't really clear to me yet. If you know what "the new location" is, then it's easy to make Aperture point to it. But that may not be the question. I think you may need to describe your workflow in more detail.
    You don't say how to review etc images on the MBP. If you're using Aperture, it must be with a library. Are you using Managed images there? So is the problem how to transfer data -- images and edits and metadata -- from the library on the MBP to the library (with referenced images??) on the desktop?
    Synchronizing libraries is not something Apple makes easy or offers any real help with. The best way to do it turns out to be to export one project at a time, connect to the other machine and its library, and import the projects. (In the process you might also Relocate images to make them referenced.)
    But your note about the laptop drive being to small is confusing. I don't see where your images are when you're on the road.

  • Need help in dispalying work item details

    hi friends
    I am Displaying work items with some details like work flow item text ,user ,agent and all
    Her along with these i need to display responsibility object(OTYPE = RY) mapped with work item ..
    For this i have Responisbility (HRS1000-stext) and responsibility object(HRp1240-objid) on selection screen .
    So finally i need to relate these responsibility and responsibility object and  work item ..
    any one have experience on these type of situation please help me .

    Hi
       your answer is helpful to me ..
       I am getting the RY objects from HRP1001 .
      And when i go to HRP1218  No records for the OBJID from HRP1001.Is it the data problem ..
      If i have the records in HRP1218 ,if we pass the TABNR in HRT1218 ..can i get the work item  with TABNR.
    Becuase when i see in HRT1218 all  records have PLANT as re field .

  • Need help to change line item text for 220 Line items

    Hi Specialists,
    The user has posted a reversal entry ( doc type : Manual Accrual) using TCODE FBS1.
    It has 220 line items.
    Is there a way in SAP he can change the text of All Line Items for a particular document number in one shot ( Mass Change).
    Pls note : Header text remains same . Only the line item text needs to be changed in one shot .
    For Eg :
      1 50 2758000047 Accruals for CAS               Accrl - Dec 08 / Nalini Marketing(Door Mats) - Oth
      2 50 2758000047 Accruals for CAS               Accrl - Dec 08 / SKC - M&E Repair
    Changed Description:
      1 50 2758000047 Accruals for CAS               Accrl - Jan 09 / Nalini Marketing(Door Mats) - Oth
      2 50 2758000047 Accruals for CAS               Accrl - Jan 09 / SKC - M&E Repair
    Thanks,
    Abhinav.

    Hi
    This is possible, please follow as below:
    If it is GL (FBL3N), Customer (FBL5N), Vendor (FBL1N) line item use the TCODE' mentioned.
    In the selection screen, if possible give all the document numbers (it is possible with addition selection).
    Once you get the output with the line item, select all line items and go to the menu options  there you can see the mass change option, it will give one popup screen give the new value in the text field and proceed further.
    VVR

  • Need help with moving sight over to Iweb

    I would like to start using IWeb but I already have a website built that I used Frontpage to create. I want to make some changes to the sight so if I cannot convert some of the things I have, Im ok with adapting!
    www.DarnGoodSeasoning.com
    1st question: (Visit site above) if you hover over the links on the left they turn green Can I do that in Iweb? I figured out how to do it with font but not pictures. I have the .gif of each in yellow and green.
    2nd When I have created pages in the past www.HeyRobi.com It changes the name in the address bar to http://heyrobi.com/Mac/HeyRobi.html Call me petty but I want it to say HeyRobi.com can I fix that?
    Thanks in advance for any help or tips. If there is any advice or tips how to improve the Darn Good site I am always up for constructive criticism. BTW I am dropping the frames!
    TIA HeyRobi

    Welcome to the Apple Discussions. 1 - The rollover options are only available for text, not images.
    2 - To get must HeyRobbi.com to show in the URL window you'll need to use standard domain name forwarding with masking. Then every page of your site will display only that. The downside to that is visitors will be able to only bookmark the first or entry page of your site. That may or may not be a problem for you. My tutorial site, toadstutorials.info, is setup with masking.
    The following is a screenshot of how I setup my site with GoDaddy.com for forwarding and masking. Although every domain name provider is different your's will have a similar setup for you to set the masking for your domain name.
    Click to view full size
    OT

  • Need help on moving a drew oval

    hey guys,
    I'm trying to build a small maze game. The game has 3 by 3 grid (squares) and four buttons (direction). This is what i've done so far, there's more to it but i'm stuck in half way. I've drew an oval at the bottom left corner (the starting psoition) and the goal is to reach at top right corner. So far i've not yet defined which square is wall and which is open. I smply wants to move the oval to new x, y position when the user click on specific direction button (south, north, east, west) but i really don't know how to do it. Please please help me! Thankyou so much =] Here is the code what i've so far:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MyMazeGame implements ActionListener {
        JButton south, east, west, north;
        JPanel main, maze, dir;
        JFrame sFrame;
        JLabel dirL;
        final int MAZE_X = 100, MAZE_Y = 150, MAZE_WIDTH = 80, MAZE_HEIGHT = 80, MIN_X = 120, MAX_X = 282, MIN_Y = 168, MAX_Y = 330, OVAL_WIDTH = 25, OVAL_HEIGHT = 25;
        int newX = 0, newY = 0, moveX =  MIN_X, moveY = MAX_Y;
        Graphics g;
        public MyMazeGame() {
            //Create and set up the different windows(Frames).       
            sFrame = new JFrame("My Maze Game"); 
            sFrame.setSize(new Dimension(70, 20));
            //Create and set up the panel.     
             * draw the grid on the panel
            main = new JPanel() {
                protected void paintComponent(Graphics g) {
                    super.paintComponent(g);               
                    g.setColor(Color.white);
                    for (int r = 0; r < 3; r++) {
                        for (int c = 0; c < 3; c++) {
                            g.fillRect(MAZE_X + newX, MAZE_Y + newY, MAZE_WIDTH, MAZE_HEIGHT);
                            newX += 81;
                        newY += 81;
                        newX = 0;
                    g.setColor(Color.black);  
                    g.setFont(new Font("Serif", Font.BOLD, 20));
                    g.drawString("START", 105, 380);
                    g.setColor(Color.red);  
                    g.setFont(new Font("Serif", Font.BOLD, 20));
                    g.drawString("FINISH", 270, 175);
                    drawNewMove (g, moveX, moveY, OVAL_WIDTH, OVAL_HEIGHT);
            dir = new JPanel();
            main.setPreferredSize(new Dimension(500, 500));
            main.setBackground(Color.black);
            //Add the extra component
            addComponents();
            //Add the panel to the window(Frames).
            sFrame.getContentPane().add(main, BorderLayout.WEST);
            //Display the windows.
            sFrame.pack();
            sFrame.setVisible(true);
        } // end 
         * run the program
        public static void main(String args[])  {
            new MyMazeGame();   
         * add the extra components (buttons, labels etc.) on the panel
        public void addComponents() {
            south = new JButton ("SOUTH");
            north = new JButton ("NORTH");
            east = new JButton ("EAST");
            west = new JButton ("WEST");
            dirL = new JLabel("Choose your direction", JLabel.LEFT);
            main.setBorder(BorderFactory.createLineBorder (Color.white, 5));
            south.addActionListener(this);
            north.addActionListener(this);
            east.addActionListener(this);
            west.addActionListener(this);
            dirL.setBackground(Color.black);
            dirL.setForeground(Color.white);
            dirL.setFont(new Font("Serif", Font.BOLD, 15));
            main.add(dirL);
            main.add(south);
            main.add(north);
            main.add(east);
            main.add(west);
         * perform all the action here
         * This method prints out the current x, y location and new x and y location when a button is clicked
        public void actionPerformed(ActionEvent event) { 
            System.out.println("Current y location: " + moveY);
            System.out.println("Current x location: " + moveX);
            if (event.getSource() == south && moveY < MAX_Y) {               
                moveY += 81;
                System.out.println("Moved down: " + moveY);    
            } else if (moveY > MIN_Y && event.getSource() == north) {
                moveY -= 81;
                System.out.println("Moved up: " + moveY);
            } else if (moveX < MAX_X && event.getSource() == east) {
                moveX += 81;
                System.out.println("Moved right: " + moveX);
            } else if (moveX > MIN_X && event.getSource() == west) {
                moveX -= 81;
                System.out.println("Moved left: " + moveX);
            } else
                System.out.println("Invalid move, can't go out of the grid");
         * draw the oval 
        public void drawNewMove (Graphics g, int x, int y, int w, int h) {
            g.setColor(Color.black);
            g.fillOval(x, y, w, h);
    }Please someone guide me, thanks a tons.

    crosspost
    http://forum.java.sun.com/thread.jspa?threadID=719728

  • Need Help in Moving from ABAP to NW Portal Development

    Hello Experts,
          I am ABAP Programmer. I am not having JAVA background and intrested in Portal Development. I had found following courses:
    JA100, JA300, JA310, SAPEP, TEP12.
    Please let me know whether these shortlisted courses are correct or not. If not, please give me correct sequence of courses.
    Thanks in Advance.
    Regards,
    Nilesh Pawar.

    Hi Nilesh,
    you better can give a try to XI (Exchange Infrastucture) which also is an important part of Netweaver Platform.
    If you are so keen to pursue EP, then you should have a minimum knowledge on Java, Core java, JSPs, API etc.
    And you can manage with webDyn pro applications where the need for coding is only 10%.
    But most of the ABAP developers find it easy to move to XI rather than EP.
    Hope this was helpful for you.
    Do offer points if you like.
    All the best and you made a good decision .
    Future seems good with Netweaver.

  • Need help with moving files?

    I now have two challenges.  As a new user I need to know how to copy my iTunes files onto a USB stick.  I am not sure how to find the files, copy them or anything,  the second thing that I need to know is how to remove files from the desktop.  While trying to copy these same music files I clicked at the wrong time and now they are all piled up on the desk top.  There are 1800 files all piled up.  Just want these gone.  Thanks for any help.

    While trying to copy these same music files I clicked at the wrong time and now they are all piled up on the desk top.  There are 1800 files all piled up.  Just want these gone. 
    Click Finder and desktop. Assuming for simplicity that there are only the 1800 files on the desktop that you want to delete them (important that you have saved them somewhere else where you want them) .... click on the first one in the list to highlight it, then move to the last one in the list, hold the shift key and click on it to highlight it. All in between should also now be highlighted. Either drag that group to the trash or right click and choose move to trash. Then empty the trash.
    If you want to copy the files on the desktop to the USB stick, follow Niel's instructions above.
    On your hard drive, you'll find your itunes library under your user ID / music / itunes

  • Need help with moving files into Itunes and syncing

    Please help.
    I have an external hard drive with my music on it.  I created a new playlist in Itunes and did a drag and drop from my external hard drive into my newly created playlist. 
    Now that I go back and play the items I brought over, I get an error that says "original files not found" and it won't play and therefore does not seem to be syncing to the Ipod to be able to play.
    Can you please give me guidance as to what I can do without recreating all the work I had already done?
    Thanks,
    Michelle

    Is the external drive connected?
    Has the drive letter possibly changed due to being disconnected and reconnected?

  • Need help on new calculated item column

    Hi Guys,
    Could you please help me with the formula on a new calculated item on the attached report?
    Details on the screen shot of the link
    http://img339.imageshack.us/img339/5606/70548266.jpg
    Thanks and Regards
    G.

    Nikkolas wrote:
    i found dv5-1251nr with 512 megs dedicated nvidia graphics ( NVIDIA GeForce 9200M GS)  Intel Core 2 Duo Processor T6400 4 gigs ram  320 hd for 849 now i tested this system with battery in
    6 cell on balanced mode internet surfing, looping a 3 min video clip, 3 other windows open including chess and the 3d game fate and battery that was 100% dropped to 75% after 30 mins, so if i figured it out right means battery lasts for about 2 hours
    this any good and whats deal with all the chips intel centrino, intel centrino 2 etc and i know amd  athlon is old and turion is better but is it that much better?
    Intel Core 2 Duo's are the most efficent, so if you are looking for good battery life, that is what you want.  Avoid AMD as they eat the battery life quite quickly.
    The battery life depends on what the computer is doing, so if you are stressing it with a lot of applications, yes the battery is going to die quicker than normal.
    My opinions are mine, and mine alone.

  • Need help on moving itunes to different computer.

    i am getting a new computer.
    But my old computer has my itunes and doesn't read disks.
    how do i transfer the itunes to the new computer without being able to use the disk drive?
    please help.

    Probably the most straightforward way to get iTunes onto your new computer is to network it with the old one and copy your iTunes folder across. This works fine if you have been using iTunes to completely manage your music and all your songs are in iTunes Music not in different folders. You can also use this method with an external hard drive, you drag the folder from the old computer to the external drive and then from the drive to the new computer. If the songs in your library are not all in the iTunes Music folder you can consolidate them. When you consolidate, any songs in the iTunes Library that are not in the iTunes Music Folder are copied to the Music Folder and the Library is updated to point to those new files. Files already in the iTunes Music Folder have no changes made to them: Copying all your iTunes files to one location - Windows
    Copying the whole folder brings with it the iTunes Music folder and also the iTunes Library (iTunes Library.itl in Windows) database file which holds all the information about your songs (Playlists, Ratings, Play Counts, Last Played, Date Added, etc). You'll get more information including the Folder/File structure in this article: What are the iTunes library files?
    When you copy the iTunes folder make sure you put it into the same location on the new computer. This has to be the exact same place, on a PC this is \Documents and Settings\Username\My Documents\My Music\. When you open iTunes on the new computer it will be the same as on the original one Songs, Playlists, Play Counts, Ratings etc. When I moved iTunes a while ago for my daughter I was also using the same version of iTunes, not sure how important that is but it's probably worth keeping them the same.
    If you have an iPod it can be used as an external drive and you can move the iTunes folder onto it: How to use your iPod to move your music to a new computer

  • Need help to read the item details while creating the Opportunity in SAP CR

    Hi,
    I need to read the values entered at item level while creating a new opportunity in SAP CRM 5.0.
    Is there any function modle to do that ? I need to read the custom fields (developed by EEWB)
    and sum  them up and populate at the header level.
    As the data is not saved yet, I cannot read from database in the present scenario.
    Thanks and regards

    Hi,
      U can use CRM_ORDER_READ.
    1) Pass the values for the ITEM guid which u want to read.
    2) ignore the other header guid and object id because it is for whole contract
    3) if u had custmize any table it will be available in the internal table returned by the function module.
    4) u have to identify which internal table will contain the field since many internal table are available with similar meaning.
    4) CRM_ORDER_ORDER is heavy function module it reads entire contract hence u need to specify which internal table u have to read any only those values will be read. for that u have to fill in <b>it_requested_objects</b>
    fill requested ogject with below statement
    INSERT gc_object_name-orderadm_h  INTO TABLE lit_import_tab.
    gc_object_name is constant structure u have to include
    *-Standard Include
      INCLUDE crm_object_names_con.
    Mark helpfull answers
    Regards
    Manoj

Maybe you are looking for

  • Restricted automatic creation of PO in sales order

    Hi Experts When we create a sales order (VA01), we had customized the automatic creation of a Production order (CO01); but our client is asking us to limit this automatic creation to a certain characteristics of the material. For example, we have to

  • What should I upgrade in my iMac 21.5"?

    I'm planning to buy an iMac 21.5 with 2.9 GHz. I have money for 2 things to upgrade but I don't know what to upgrade! I use my mac for Photoshop, AutoCAD, Solid Works (Parallels with Windows 7) and obviously other smaller programs like Spotify, iTune

  • What do I need to do to make this transparency work

    I have a PDF, I know it has transparency but Acrobat pro renders the transparent portion solid. If I view it in chrome it looks right. And if I do an output preview and change the "Show" option to "Not DeviceCMYK" it previews the transparency, but th

  • Trigger mail to vendor's company correspondence email for debit memos

    Hi We are issuing output for debit memos through MR90 for external send (nacha = 5) An email is sent to the vendor's email id maintained in the first page of XK02. However the email needs to be sent to the company correspondence email id (LFB1-INTAD)

  • Xorg 7.4 - Resolution, Fontsize and RighClick with Touchpad

    Hello, how thousand users I have massiv problems with the new Xorg 7.4, see here: 1)I start X11&Gnome with startx, but since the upgrade on 7.4 Xorg semes to load a lower resolution first and after loading my desktop the correct resolution, this was