|
Well we would then look at the corresponding customer information to make sure we had the correct info. Sorry this really isnt a real life situation as we shouldnt have two customers with the same name.
|
|
|
|
|
I think your question has more to do with your design and how you manage your customer lists, than with how to use a combo box.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
So how would you design? Very odd this is like DB101. If you had a student table with five students named john smith you identify the difference by there id.
So are you saying that if I want to query a table based on the selection I have to have customer name referenced in other tables??? No that cant be right I look at referential db's most of the day they are linked on ids not names??
Someone out there must have run into this along the way.
|
|
|
|
|
Chrisloys wrote: So how would you design? Well, without spending a lot of time thinking about it I am not sure.
Chrisloys wrote: Someone out there must have run into this along the way. Quite possibly, but I get the feeling this has very little to do with Java.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
the java part is the jcombobox referencing the id of customer name selected.
If anyone could shed some light it would be most appreciated.
Thanks for all your responses.
|
|
|
|
|
Well looking at the documentation[^] it is clear that the items in the combobox can be objects, so you just need a class of object that contains the name and the id of the customer. The object's ToString() method should return the name which (I guess) will appear in the combo box.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
pls how do i solve a=1/2bh
v=ut+1/2gt
s=a+(n-1)d using java programming
|
|
|
|
|
What is the issue you are facing ? Did you even try to write any code ? Please share your code (attempt) with us.
Apurv
If Java had true garbage collection, most programs would delete themselves upon execution.
|
|
|
|
|
First you define your variables (a, v, etc), then you write the code to do the calculations. Which part are you having difficulty with?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
can we in any way extract battery percentage of the laptop in our java program...i am doing this search on net since last week and no results...please help me regarding this problem...
|
|
|
|
|
I do not think you can do it directly in Java. The information is provided by this WMI class[^] of the Windows API. You would need to write some C/C++ code to get the information into a DLL, and use JNI to access that from your Java code.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
import java.io.Console;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
public class RegexTestHarness {
public static void main(String[] args){
Console console = System.console();
if (console == null) {
System.err.println("No console.");
System.exit(1);
}
while (true) {
Pattern pattern =
Pattern.compile(console.readLine("%nEnter your regex: "));
Matcher matcher =
pattern.matcher(console.readLine("Enter input string to search: "));
boolean found = false;
while (matcher.find()) {
console.format("I found the text" +
" \"%s\" starting at " +
"index %d and ending at index %d.%n",
matcher.group(),
matcher.start(),
matcher.end());
found = true;
}
if(!found){
console.format("No match found.%n");
}
}
}
}
|
|
|
|
|
I don't know where you got that console hassle there - it's a complete mixup.
Your code works when the console is addressed right:
public class RegexTestHarness {
public static void main(String[] args) {
while (true) {
try {
BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter your regex:");
String strValue = console.readLine();
Pattern pattern = Pattern.compile(strValue);
System.out.println("Enter input string to search:");
String strMatch = console.readLine();
Matcher matcher = pattern.matcher(strMatch);
boolean found = false;
while (matcher.find()) {
System.out.println(String.format("I found the text" + " \"%s\" starting at "
+ "index %d and ending at index %d.",
matcher.group(), matcher.start(), matcher.end()));
found = true;
}
if (!found) {
System.console().format("No match found.");
}
} catch (IOException oException) { oException.printStackTrace();}
}
}
}
|
|
|
|
|
Still a problem Sir, it says: the method console() is undefined for the type System.
|
|
|
|
|
*däng* I missed that one, please change that too:
if (!found) {
System.out.println("No match found.");
}
Do you understand what had to be changed?
|
|
|
|
|
dont worry i changed it to:
System.out.println(String.format("No match found.%n"));
|
|
|
|
|
hallo Mr Torsten, i want us to collaborate on developing a cancer registration form for the
SA government. we gonna use java. the problem is that i dont know how we gonna integrate it into an already existing program because it doesn't meet the standard requirements.
|
|
|
|
|
You need to figure that out.
Please also check out GWT, which is a java based JS-Solution for Web based applications. Could be pretty helpful and is easy to use with java coding.
Have fun.
|
|
|
|
|
hi, anyone help me making mobile web voting system?...
|
|
|
|
|
Try reading this section[^], then try asking a more specific question.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Assume we have a server A waiting for searching request, when such request comes the server A will multicast it to many other servers Bs each of which has a directory contains many text files and as a response to the request each of Bs servers will search inside these files for the requesting word and return the results to server A which in turn will return the file name and the location of each result to the requesting client
so
notes:
1- Server A must be multithreaded i.e. the thread which multicasts the request differs from the one which receives the results, so there must be an ID for each request.
2- Servers B also are multithreaded.
3- Multicast will be over MulticastSocket with UDP
so help me in coding that in java
?????
|
|
|
|
|
You need to be rather more specific about what help you expect. It's unlikely that anyone will provide a complete implementation for you.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
i am developing a email server in java i want to know should i use some dbms to store user emails or simple files
|
|
|
|
|
It depends on the complexity of your system. If you anticipate needing to store lots of data then a proper database system is the obvious answer.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
a database is fine. I would use derby[^].
It's well documented, integrates completely and is easy to handle.
You can also use a file based system. But that is much more complicated.
|
|
|
|