masijade 1,351 Industrious Poster Team Colleague Featured Poster

Unfortunately for you, SQLite is one of the least compliant DBs.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That depends. If you use SQL that is specifc to that DB, then no, 100% compatable it is not. And since not all DBs implement the entire range of SQL98 you can't even be sure of being compatable when sticking to that. But, for the most part, sticking to SQL98 will make the program about 99% compatable. It's only when you get into complicated statements and/or optimizing statements that you get into real problems.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

No. It wouldn't. Normally you don't make JFileChooser part of another dialog, as it is a completely self-enclosed Dialog itself, you need simply use it. See http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Um, I'm sorry, but what is wrong with JFileChooser?

In any case, if you insist on recreating the wheel, here.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

:sigh:

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Did you search for exactly "SQLite JDBC Driver". If so, the very first link works, but there are many others, and the third link (the one from sqlite.org) has a list of possible drivers. Take your choice.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

It might help to see this "LOGIC ITERATOR", but if you are doing something akin to

while(next()) {
  if (valid) {
    print data
  }
  print newline
}

then, yes, of course, it is coming from your "LOGIC ITERATOR", don't do that.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I got your back.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then you need to use a user with admin privileges. I don't know why that is so hard for you to understand.

The only thing you can do with Java in the registry are the "preferences" type entries anyway, and if you are using the "user root" instead of the "system root" there is no problem. If you need to use the "system root", then you need to use a user with admin privileges.

Otherwise you are using command line tools or JNI, and you still need to remain within the system security processes.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, what do you think. We are not here to do your homework/quiz for you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then use .Net

Nick Evan commented: haha +11
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Hi!


i creating java apps to edit windows registry ....

it is fine in Xp but in Vista its need admin privileges..

how do get it programmatic-ally...

You don't. You'd have to execute under a different user, of course.


in .net app.manifest is there..but in java anything is for admin privil..

Yes, the user under which it executes.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

:sigh: double :sigh:

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Yes. Write a Comparator. (see the API docs for Comparator and the Collections Tutorials)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Try "outer" joins

select i.code,s.date_sale
from Item i, Sale s
where i.code = s.code (+)
  and s.date_sale <='2009-01-31' (+)

Edit: Although I don't know HQL, at all, I am assuming it is one of the in Java written DBs and so should still understand basic SQL. I'll probably look into HQL, to find out what it really is, but I've had no reason to, yet.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay, I know NeilCoffey explained it long before, somewhat, but I, now, will still give a full explanation. It has to do with "literal" data. I.E. data that you type directly into code.

Boolean data is just that, the boolean

true   false

Strings are surrounded by quotes

"string"

If you want a char (or Character with autoboxing) you use single quotes

'c'

A literal number is somewhat different. A literal number, without a decimal point is an integer, if you want a long you need to append an L

//integer
123
//Long
123L

A literal number with a decimal point is a double, if you want a float you need to append an f

//Double
1.23
//Float
1.23f

If the lefthand variable is declared as a different type, and the literal can be "widened" to that type, no problem. If the right hand literal can not be "widened" to equal the lefthand side (i.e. the lefthand side can only hold smaller values) then you need to explicitly cast the literal, or, better, use the proper literal.

//OK
long longVar = 123;
double dVar = 123;
double dVar2 = 1.23f;  // Have no idea why you would, but hey
int intVar = (int) 123L;  // Once again, no idea why you would, but hey
float fVar = (float) 1.23;  // ditto again
//Not OK
int intVar = 123L;
int intVar2 = 1.23;
floatfVar = 1.23;
masijade 1,351 Industrious Poster Team Colleague Featured Poster

So write one. If you need help getting it right post your code (and nay and all errors) here and we will help you correct it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

It has found the node, but the word itself, i.e. Apple is a child node of the "word" node, a TextNode type.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, as I can, see this is some sort of quiz, or homework, so I am not simply going to give you the answer which is the reason I asked you what you think it for.

No one said you had to know/provide the right answer, immediately, but it will, eventually, be an answer that you figure out, with clues and hints and corrections along the way, not an answer that you are given. If you want an answer given to you then wait on the corrections provided by your instructor after whatever it is has already been graded.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, then, Google for SQLite JDBC Driver. There is one out there. It is not a Type 4.0 Driver (AFAIK), however.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What do you think it is used for?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Check JMF

That is the first link under the google search provided. ;-)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Not the sort of thing Java is meant for.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

There is no "conversion" involved. It is a simple cast, and after the return the instance will still be the same type it was before. And, it's not possible to "dynamically" change the return type of a method anyway, so the entire is doomed to failure. Maybe if you would explain what it is you are actually trying to accomplish we could help you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

We will be more than happy to help you. Post your code with a complete listing of all compiler message and/or exception messages and complete, but brief description of what, exactly you are haviong a problem with and we will help you correct it. But, when you dump an assignment text and say "do this by saturday" what are you expecting? I'll tell you what you're expecting. You're expecting someone to do it for you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Someone must have moved something, or something, as this popped up in my mail as if it had been replied to, and now that I look at the post above mine, I realise that that post is old too, I had just assumed it was just posted. ;-) Ah well, sheet happens.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I want solution for code before saturday

Then you'd better get cracking. We are not a homework (cheating) service.

Maybe next time you'll do your homework rather than go partying.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, there is at least a link to the methods from the "derived" classes (the "methods inherited from ..." blocks, but it is such a pain to read those blocks, at times. Especially with Swing elements where there seem to be hundreds of inherited methods. If they were at least formatted better, it might not be so onerous. ;-)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Ah, yes, I forgot all about that. ;-) (Even though it is prominently presented in the beginning remarks of the API docs for JComponent, whoever looks at the API docs JComponent. ;-) )

masijade 1,351 Industrious Poster Team Colleague Featured Poster

How are you determining that it "doesn't recognise \n"? If you are "checking" the file with Notepad, it is that notepad "doesn't recognise \n", try checking with wordpad (assuming you're on windows, and on MAC the "newline" character is "\r" on Windows it is "\r\n").

You shouldn't be using "\n" anyway, you should be using System.getProperty("line.separator"); .

But, I can guarantee that it is writing everything you tell it to write. It might not write the last x bytes, though, if you do not flush and/or close it properly.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? And your question is?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I knid of doubt that will help though, as the majority of peoples names (as the variable implies that that that is) will not be alphabetically less than end. What the OP probably wants is if (!salesPersonsName.equals("end")) . And this thread is bit old, anyway. I doubt the OP is still looking for a solution.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

It's not, necessarily, bad. There is a small (but it is small) chance that there will be name conflict doing so, but with numbers that small I doubt it.

It is a bit of mixing GUI code with business logic which is not what you want to be doing, but I don't know how you are doing the rest of the app, or even what it is doing, so I can't even really judge that.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What are you trying to do with that override? Simply draw a line along the top of the panel? If that is the case I would write my own border class. The easiest way to do that one would be to copy LineBorder (and name it differently, of course) out of src.zip and modify that to simply draw a single line on a single side rather than drawing a rectangle.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

after j.add add j.validate() and j.repaint(), and then try again.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Sometimes it's only the search string, but it helps to list what you've already done so people are not repeating suggestions that have already been tried.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Showing your code might help. Mainly for the overridden JPanel (which I do not know why you are doing that if you are simply adding elements to it), and for the "text change" on the button.

Better would be if you took the time write a very small, compilable, and executable, program that duplicates the problem. Successfully doing this will, many times, will present the solution to you in and of itself.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because the only print statement you have there refers to one specific element (and actually it doesn't refere to any of them since index is undefined there).

You, of course, need to create another for loop in that case section just like under the case section 1.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You don't have to.

Simply do readLine until it returns null as shown in the second example in the Tutorial.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Alright, whoever voted that down be man enough and stand up to admit to it (which is probably the reason (s)he didn't use the "rep" link, as that transmits the userId along with it).

Who was that didn't like the fact that it was pointed out the user crossposted, without being respectful enough to refer to the original post, so that anyone answering here would more than likely simply been wasting their time by making suggestions that have already benn made, as happened above?

In that case, I will ask you if also pay bills your partner has already paid? Do you sweep the floor 5 minutes after someone else has already done it? Etc, etc. All of these are a waste of time and/or money (which a waste of time is a waste of money, even if not always yours), including the cross-posting.

So, who took offense at the fact a cross-post was pointed out (in an attempt to save others from wasting their time), but didn't take offense at the cross-post itself?

And, for the record, I have nothing against cross-posting to another site, as long as the OP makes reference to the other post so that any one responding can see what's already been suggested rather than wasting their time repeating things.

Edit: Then again, it was probably the OP that voted it down, since the repeat answer is already voted down and the truth is simply too much to bear (i.e. …

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What do you mean "in one activity"?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Rather than Scanner use a BufferedReader, its readLine method, and String's split method.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster

What does "User" constructor do? (IOW It's code, please.) As I find it very hard to believe that that line will throw an NPE, unless the constructor is catching one then rethrowing it, maybe, and then it should be the "throw" line in the constructor that is listed rather than that line. I believe that that is not the line throwing the NPE, and I don't believe that the exception got the line number wrong.

As a side not, you should definately not be using scriptlets in your JSP pages. Break that stuff out into external classes, or, in this case, a Filter may be better.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then maybe you should download a newer version of iText.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then check that those packages are actually there. Check that the classes you're attempting to call are actually in those packages, and check that everything is spelled right.

If all those classes are suppossed to be in that jar, and they are in that jar, and you are using the right classes (with full package), and they are not mispelled, then they will be found. The compiler does not pick and choose which packages from a jar to include, and which not. So, if the jar exists, and contains the things you are trying to use, then the problem is yours. Either mispelling, wrong package for the class, or the jar not properly included on the class path (i.e. build path in this case).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

"project properties"
"build path"

masijade 1,351 Industrious Poster Team Colleague Featured Poster

The "thread" is the right idea, but probably done wrong. It might help to see the code. However, recreate the code in a small GUI that contains nothing but the textarea and the "loop" (and any extraneous items "in between" that actually contribute) that displays the problem you're seeing.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

One thing that might cause "strange effects" is the way that public static final (or protected/default static final for sub/package classes) are handled. Those values compiled directly into the class using them, so a change to one of those without recompiling the classes that use them will cause a "disconnect". I.E. the other classes will still be using the original value.