|
Looking at his code, he mis-typed his closing "pre" tag. A simple human error!
modified on Thursday, June 4, 2009 6:33 PM
|
|
|
|
|
ItIsFinished wrote: A simple human error!
A simple human would fix it.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Hello guys,
I am developing a mobile application and in this application i need to read an XML file. Now im trying to add the following packages to read an xml file:
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
After trying to import these packages NETBEANS 6.5 gives me the following error message javax.xml.parser not found.
When i try to use these packages in a normal java applicaion it works fine but when using them with the mobile applicatoin the above mentioned error comes up. Can anyone tell me how I can fix this or if there is any other solution? sorry for the trouble but I am a bit new to java.
|
|
|
|
|
Without firing up google, I think you'll find that the whole of javax is not part of Java ME.
blox. It is supported, see here[^]
That may help you. All I can guess then is you have got part of the J2ME SDK missing/not installed?
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Hello, I have successfully used jComboboxes as cell editors in a jtable using the code below which is all in one method.
My question is, how can i get the item (or index for that matter) selected in the combobox that's inside the jtable?
Using table.getmodel().getvalueat() doesn't seem to work.
Thanks!
DefaultTableModel model = new DefaultTableModel() {
@Override
public boolean isCellEditable(int row, int col) {
if(col>2)
return false;
return true;
};
};
TableColumn col;
int vColIndex,width;
JComboBox comboBox;
TableColumn colcombo;
colcombo = jTable1.getColumnModel().getColumn(2);
comboBox = new JComboBox();
comboBox.addItem("Iniciado");
comboBox.addItem("En proceso");
comboBox.addItem("Consolidado");
colcombo.setCellEditor(new DefaultCellEditor(comboBox));
|
|
|
|
|
My apologies if I'm wrong, I'm at work and can't check out the API right now.(navy so I'm not allowed any excess material here) But the method should be as simple as
comboBox.getSelectedItem(); //should return an Object, cast it to String if need be
//or
comboBox.getSelectedIndex();
I hope this helps, have a good day. (It's just off of the top of my head.)
|
|
|
|
|
You'd think that, but no. :S
I tried that and it works only for the selected item in the LAST combobox that was modified, but when you have more than one row in a jtable and each one of those rows has a combobox that's referenced by the same variable (combobox) it only returns the last change that was made to the object.
What I need to do is I have a jtable and I need to go through all of the rows to record those values in a database.
|
|
|
|
|
I want to try a simple program with java for my Nokia cell phone. Is there anybody to help me?
Sourie
|
|
|
|
|
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
/**
* @author Internet
*/
public class Midlet123 extends MIDlet implements CommandListener{
private Command Ok;
private Display dis;
private Form form;
public Midlet123()
{
dis=Display.getDisplay(this); form=new Form("My First Middlet");
Ok=new Command("Exit",Command.OK, 1);
form.setCommandListener(this);
}
public void startApp() {
dis.setCurrent(form);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void commandAction(Command arg0, Displayable arg1) {
if(arg0==Ok)
{
destroyApp(true);
notifyDestroyed();
}
}
}
|
|
|
|
|
The loop cant be stop eventho the key-in matches. Can anyone fix this and tell me my mistake?
Greatly appreciate it if so!
<br />
import java.io.*;<br />
<br />
public class A<br />
{<br />
public static void main(String args[]) throws IOException<br />
{<br />
BufferedReader stdin=new BufferedReader (new InputStreamReader(System.in));<br />
String name,pwd;<br />
int n1;<br />
int p2;<br />
<br />
System.out.println("\tWelcome to ");<br />
System.out.println("*******SHINE IT Training Centre*******");<br />
System.out.println("**Please login before u calculate**");<br />
<br />
do<br />
{<br />
System.out.println("Enter user name: ");<br />
name=stdin.readLine();<br />
n1=Integer.parseInt(name);<br />
System.out.println("Enter password: ");<br />
pwd=stdin.readLine();<br />
p2=Integer.parseInt(pwd);<br />
<br />
} while ((name!="2208")&&(pwd!="1234"));<br />
<br />
<br />
System.out.println("Successful Login!!");<br />
<br />
}<br />
}<br />
|
|
|
|
|
eigther change
while ((name!="2208")&&(pwd!="1234"));
to
while ((!name.equals("2208"))&&(!pwd.equals("1234")));
or
while ((n1!=2208)&&(p2!=1234));
|
|
|
|
|
oic! Thank you very much!!
|
|
|
|
|
I have a class JPanel that I want to add other JPanels onto during run-time. I can add a JPanel using the NetBeans IDE for "design", but the IDE will not let me dynamically add a new JPanel and let me position it on the main JPanel . When I look at the documentation, it appears that there are inherited methods that would allow this type of operation, such as setLocation(int, int). The IDE complains about this method, and the list of available methods that appears when editing the code, has a very limited set. Is there a way around this using the IDE?
Thanks for your time.
AF Pilot
|
|
|
|
|
Reagan Conservative wrote: I have a class JPanel
I would rename your class to something more appropriate if I were you.
If you have a look at the code Netbeans generates with the designer, then you will see something which looks like this.
JPanel jp = new JPanel();
[InsertParentControlHere].add(jp);
Add that in the code where you need it.
My failometer has shot off the end of the scale!
I seem to have misplaced my ban button.. no wait... found it!
|
|
|
|
|
I was just using this as a generic example. The actual name is not JPanel. I was going to try and use this "JPanel" to draw graphics on and place it on another "JPanel". I think that the better approach is just to draw directly to the "JPanel" without adding a whole bunch of smaller "JPanel"s.
Thanks for replying.
AF Pilot
|
|
|
|
|
Apologies, I misunderstood.
Reagan Conservative wrote: I think that the better approach is just to draw directly to the "JPanel" without adding a whole bunch of smaller "JPanel"s.
Agreed, I see what you mean about inheritence now. Overriding the paintComponant method should do the trick. Have a look at this[^], it may help.
My failometer has shot off the end of the scale!
I seem to have misplaced my ban button.. no wait... found it!
|
|
|
|
|
I want to develop a company visitors software. the software will have the following columns:
Visitors name
Purpose of visiting
Who you are visiting
time in
time out
I am having a problem in how the interface should be. I am new in programming please can you descibe for me how the interface should be. especially the time out column. the managment should be able to see those who visited.
Thank you
|
|
|
|
|
Err, this has nothing todo with Java; unless that happens to be the language used in your school.
Alternatively, if this really is for work, use a sheet of paper that visitors sign in and out on.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Some remarks:
1) Don't cross-post, this is considered rude.
2) Provide a meaningful title for your message.
3) Read the posting guidelines (the first message on top of the message boards) before posting.
|
|
|
|
|
how can Read Barcode from an image
|
|
|
|
|
|
i'm trying to overload a method in a web service using netbeans, but the problem is i don't see the overloaded method in the test page , anyone got an answer for this
|
|
|
|
|
with mobile ,Can you tell me java or c# can easier to develop and more popular at The developing country,example viet nam
thanks
|
|
|
|
|
It really depends on the type of mobilephones you want to develop for.
I'd say that for most of the simple mobile phones, you'll better go with Java, but there are more and more smartphones coming up with windows mobile which will perfectly fit with C# (Compact Framework).
I won’t not use no double negatives.
modified on Wednesday, May 27, 2009 7:52 AM
|
|
|
|
|