Removing items from list
hi all,
i am having a list in which there are 4 elements in it.
i need to remove the first and third elements in the list and make an iterator out of the modofied list
i can create the iterator but can any one help me in removing specific elements in the list
regards and thanks in advance
i have seen this .there is no method to removeitems
at specific locations
sigh
What is
[url=http://java.sun.com/j2se/1.5.0/docs/api/java/util
/List.html#remove(int)]this then ?This forum needs an introductory list of tips and
tricks. Very high on
that list should be a link to the JavaDoc API
documentation or a link to
the download site where everyone could download the
darn thing.
Now the question remains: how to make everybody
read those API docs?
kind regards,
Jos
I sadly suspect there needs to be a tutorial on HOW to read the API docs. :(
PS For future question on deletions just ask the Sun admins as they would be the experts.
Similar Messages
-
How can i remove items from list that have been deleted when i click on them it keeps showing empty
how can i remove items from the list that have been deleted when i click on them it keeps showing folder empty
Actually, Reader SHOULD keep showing documents that no longer exist, I disagree. It's no big deal, and people will quickly realise why they can't open the file. They open more files, the old ones move off.
The REASON why it should not check is that checking whether a file exists can take a long time when things aren't good. For instance if a file server goes down, or a memory card is unplugged. That in turn would mean delays opening the File menu, and I've seen some software that can sit there for several minutes. That would really give people something of which to complain... -
JList run time errors when removing items from list
Hi there
I am having trouble removing items from a JList. For a While it was working fine and now it outputs runtime errors everytime samething gets removed from the lsit
Here is the code
//declare
public class Consumertab1gui extends JPanel implements ActionListener
public static JList conList = null;
private static DefaultListModel model = null;
// Create a list with some items
model = new DefaultListModel();
conList = new JList(model);
//set the size of cells in the list with the length of the string
conList.setPrototypeCellValue("Lenght 1234567890");
conList.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
conList.addListSelectionListener(new ValueReporter());
//set a scroll onto the list
JScrollPane conScroll = new JScrollPane(conList);
add(conScroll,c);
//when the button gets pressed to drop the selected item the following code is called
private void dropConsumer()
int selItem=0;
componentsV.comVRemove(conList.getSelectedValue().toString());
selItem=conList.getSelectedIndex();
System.out.println("No:"+(model.getSize()-1));
System.out.println("S:"+selItem);
remConList(selItem);
dropCon.setEnabled(false);
//which in turns calls this
public void remConList(int pos)
model.remove(pos);
when the model.remove(pos) code is executed the following runtime errors are given:
java.lang.NullPointerException
at Consumertab1gui$ValueReporter.valueChanged(Consumertab1gui.java:197)
at javax.swing.JList.fireSelectionValueChanged(JList.java:1321)
at javax.swing.JList$ListSelectionHandler.valueChanged(JList.java:1335)
at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:187)
at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:167)
at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:214)
at javax.swing.DefaultListSelectionModel.removeIndexInterval(DefaultListSelectionModel.java:546)
at javax.swing.plaf.basic.BasicListUI$ListDataHandler.intervalRemoved(BasicListUI.java:1561)
at javax.swing.AbstractListModel.fireIntervalRemoved(AbstractListModel.java:160)
at javax.swing.DefaultListModel.remove(DefaultListModel.java:478)
at Consumertab1gui.remConList(Consumertab1gui.java:38)
at Consumertab1gui.dropConsumer(Consumertab1gui.java:58)
at Consumertab1gui.actionPerformed(Consumertab1gui.java:46)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
can anyone spot any mistakes in the code or suggest possible resons as to why these run time errors occur?
Thanks
alexisjava.lang.NullPointerException
at Consumertab1gui$ValueReporter.valueChanged(Consumertab1gui.java:197)The NullPointerException occurs at line 197, in the valueChanged method of your ValueReporter inner class. I have looked through your post several times but I don't see where you posted that method. Anyway, that is where you should look.
PC² -
Removing items from List Component
Below is a function set that's used to get info from an XML
source(s) and populate a List Component (videoList). Works great.
The second function loads data from a separate XML source and
populates the SAME List Component. When the second function is
called it loads the data in addition to the existing data into the
List Component. I want it to REPLACE the data. How would I
accomplish this?
public function getXMLdata(event:Event):void {
var campXML:XML = new XML(xmlLoader.data);
var vid:XML;
for each(vid in campXML.vid) {
videoList.addItem({label:vid.attribute("desc").toXMLString(),
data:vid.attribute("src").toXMLString(),
text:vid.attribute("text").toXMLString()});;
videoList.selectedIndex = 0;
videoList.addEventListener(Event.CHANGE, playnewvid);
FLVPlayer.source = videoList.selectedItem.data;
FLVPlayer.pause();
clipText.text = videoList.selectedItem.text;
public function getXMLdata2(event:Event):void {
var nflXML:XML = new XML(xmlLoader2.data);
var vid:XML;
for each(vid in nflXML.vid) {
videoList.addItem({label:vid.attribute("desc").toXMLString(),
data:vid.attribute("src").toXMLString(),
text:vid.attribute("text").toXMLString()});;
videoList.selectedIndex = 0;
videoList.addEventListener(Event.CHANGE, playnewvid);
FLVPlayer.source = videoList.selectedItem.data;
FLVPlayer.pause();
clipText.text = videoList.selectedItem.text;
}That took 2 minutes! Works like a charm Manno. Thank you for
your response.
For those curious, here's the solution:
public function getXMLdata(event:MouseEvent):void {
videoList.removeAll();
var campXML:XML = new XML(xmlLoader.data);
var vid:XML;
for each(vid in campXML.vid) {
videoList.addItem({label:vid.attribute("desc").toXMLString(),
data:vid.attribute("src").toXMLString(),
text:vid.attribute("text").toXMLString()});;
videoList.selectedIndex = 0;
videoList.addEventListener(Event.CHANGE, playnewvid);
FLVPlayer.source = videoList.selectedItem.data;
FLVPlayer.pause();
clipText.text = videoList.selectedItem.text;
public function getXMLdata2(event:MouseEvent):void {
videoList.removeAll();
var nflXML:XML = new XML(xmlLoader2.data);
var vid:XML;
for each(vid in nflXML.vid) {
videoList.addItem({label:vid.attribute("desc").toXMLString(),
data:vid.attribute("src").toXMLString(),
text:vid.attribute("text").toXMLString()});;
videoList.selectedIndex = 0;
videoList.addEventListener(Event.CHANGE, playnewvid);
FLVPlayer.source = videoList.selectedItem.data;
FLVPlayer.pause();
clipText.text = videoList.selectedItem.text;
} -
How can we remove items from the VF04 list?
We have a long list of items in VF04 that, for various reasons (some process related, some due to errors), are not to be billed. We have looked at applying filters to the list but there is nothing really suitable to hide these individual documents e.g. we could filter out some dates where none of the items on that date are to be billed but other dates have a mix of items we want to bill and others we don't.
I have done a search of this forum but didn't find a previous topic with a quick and simple method to remove items from the list .
Is there a method, other than billing them or sorting each issue individually, to permanently remove individual documents from the VF04 list?
Thanks in advance for any help.
DavidHi,
David,
Download a list of Pending delivers doc form VF04.
Paste the list in T.Code : VL09 (Delivery reversal) and reverse the delivery.
Then go to T.Code: VL06G Select the list of deliveries that has been reversed, select/delete all un- wanted deliveries.
This way you can remove all unwanted pending deliveries forn Billing due list (VF04).
Thanks & Regards,
R.Janakiraman -
HT5429 How do I remove items from the "current location/to" list?
In MAPS, how do I remove items from the "current location/to" list?
Hit the book icon and you will see delete all option. I have not found a way to delete them one at a time.
-
Removing items from itunes wish list
iTunes will currently NOT let me remove items from my wish list inside the itunes store. Even when I've selected the item to buy, it stays in my wish list... I need to remove items that have either been purchased, or that I no longer wish to buy. Thanks for the help!
Looks like it's not just you having problems : https://discussions.apple.com/thread/3093114?tstart=0
Normally pressing the 'x' on or next to the item should delete it (http://support.apple.com/kb/HT1368), but it doesn't appear to be working at the moment. -
How to remove items from my reading lists on my ipad?
how to remove items from my reading lists on my ipad?
Swipe across its name in the list and it should get a Delete button on it - tap that and it should be removed from the list
-
How to remove item from my iPhone and iPad on my reading list?
How to remove item from my iPhone and iPad on my reading list?
Swipe across its name in the list and it should get a Delete button on it - tap that and it should be removed from the list
-
We recently upgraded from CRM 2011 to 2015.
When users pick a queue item to work on, and check "Also remove item from Queue" - where does it go? I cannot find a view that lists these items anywhere???Hi This depends on, which entity is in the queue. If it is an opportunity it could be found in opportunities If it is an email it could be found in activities etc. If you upgraded from crm2013, where could you find it before update to crm2015? Hope it
helps. Gr.peb -
How do i remove items from my cloud
how do I remove items from my cloud
You'd have to go into the various apps on your device that store data on iCloud and begin trimming files. For example, Contacts and emails that are stored on icloud, must be deleted using the Contacts and Mail apps. Be aware that deleting data from icloud will also remove if from your device.
Backups:
Go to Settings>iCloud>Storage & Backups>Manage Storage; there, tap the device you need info on and the resulting screen lists Backup Options with which apps store data on iCloud. Turn off camera roll and any other apps that might have a lot of data. Then delete the backup. That will free up space. Photos should be regularly synced to a computer (like you store photos from a digital camera) using either USB via iTunes (on a mac use iPhoto or Aperture to move them to an album) or using photo stream. Go to Settings>iCloud and turn that feature on.
Emails:
Regarding emails, on the computer, move emails from mailboxes in icloud to those on the device. That can also save a lot of space.
Also see: http://support.apple.com/kb/ht4847 -
How can i update/Remove Items from AR Invoice using SDK?
Hi All,
I have 1 problem with update or remove item from sales order. here is the source code of mine.
If inv.GetByKey(DocumentNumber) = True Then
inv.CardCode = cardcode
Dim ercode As Integer
Dim ind As Integer = 1
For Each drow As DataGridViewRow In gv.Rows
If gv.Rows.Count = ind Then Exit For
ercode = drow.Cells("No").Value
inv.Lines.SetCurrentLine(ercode)
'inv.Lines.ItemCode = drow.Cells("itemcode").Value
'inv.Lines.ItemDescription = drow.Cells("itemname").Value
inv.Lines.Quantity = drow.Cells("qty").Value
inv.Lines.Price = drow.Cells("price").Value
ind = ind + 1
Next
errorcode = inv.Update
If errorcode <> 0 Then
PublicVariable.oCompany.GetLastError(errorcode, errorsms)
Else
errorcode = 0
End If
Else
errorsms = "Not found Invoice Document Number"
End If
After update, it error "[INV1.Quantity][line:1],'Field cannot be updated (ODBC -1029)'"
Does anybody know about this?
Thanks
TONYHi $riniva$ Rachumallu,
This is my mistake that not test manually in application.
Thanks
TONY -
How do I remove items from the cloud without losing them permanently?
My icloud storage is almost full. How do I remove items from the cloud and not lose them?
What items?
Purchased music, movies, TV shows, apps, and books do not use up your iCloud storage.
See the link below for how to reduce the amount of storage you're using:
http://support.apple.com/kb/HT4847 -
How do you remove items from the assets panel that are duplicated?
How do you remove items from the assets panel that are duplicated?
If you add an item to a slideshow, you'll usually see 2 entries for that image in the assets panel - one represents the thumbnail, and the other represents the larger 'hero' image.
It sounds like you may have added the same image to your slideshow twice. You can select one of the hero images or thumbnail images in your slideshow and use the delete key to remove it. Then the extra 2 entries in the assets panel should disappear. -
How do you remove items from the start up disc
How do you remove items from the start up disc?
Freeing Up Space on The Hard Drive
You can remove data from your Home folder except for the /Home/Library/ folder.
Visit The XLab FAQs and read the FAQ on freeing up space on your hard drive.
Also see Freeing space on your Mac OS X startup disk.
Maybe you are looking for
-
Probably a silly question. I am running Snow Leopard and for a couple of days have not been able to send mail from my long-time Apple email account. I have started the move from Mac/Mobile Me email to iCloud, when all I really need is to enable the
-
Error in Stoerd Procedure But working in Anonymous Block.
declare Cursor Cur Is Select 'Alter '||Object_Type||' '||Object_Name||' Compile' Invalid_Obj, Object_Type, Object_Name From Dba_Objects A Where A.Owner='Dataload' And A.Status='Invalid' ; Begin For I In Cur Loop
-
XML data - charset encoding problem
Hello all, I am facing an issue on charset encoding. My requirement is to send an XML and read the the output XML to display the output. The output XML is encoded in "ISO-8859-1" and we are retrieving/reading it in "UTF-8". But some special charact
-
Wiki Tutorial XML file 2 XML File is incomplete?
Hi there, i have a problem. I want to read thw Wiki: https://wiki.sdn.sap.com/wiki/display/XI/XMLFile2XMLFile Bute the tutorial is incomplete.. It end abrupt at point 3. Click on "New Product" Button to create a Product. !https:// Did anybode have th
-
HT5026 Keynote is not working with Lion. It will not open, any suggestions?
It is 5.1.1 but it crashes when I try to open it. Any suggestions? I have Lion on a MBP