masijade 1,351 Industrious Poster Team Colleague Featured Poster

HTH :)

Hold Their Hand? ;-)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

In that case, without JNI, no, not that I know of, and with JNI, you are not platform independent. And you're not platform independent anything with MS Office, whether it runs on MAC or not. I wouldn't be surprised, in the least, to find out that any ouside API, which it would need to be to work with Java, is radically different on MAC than it is on Windufus which destroys any "platform independence".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, take a look at the site, yourself, and figure out what it is doing in AJAX, and do that.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

If your first coordinate (sorted by y then x as you add hoizontally) and you have a 3 x 3, is 2,2 (first cell coordinates as 1,1) you need to do add(new JLabel(" ")) four times then add(new JLabel("*")) to produce the following (I will use "O" instead of an empty space so that you can actually see the effect)

-------
|O|O|O|
-------
|O|*| |
-------
| | | |
-------

As I said, there is no add(comp, x, y) (except with null, which is an anti-layout). There is an anlternative with GridBagLayout, but that is very hard to use. You need to add something to every cell. Otherwise, as I said, look into Canvas, GridBagLayout, or use a null layout (and Google for how to do that last as I will not recommend it), but with the first and third option, the x and y coordinates are in pixels, so have to remember to account for the size of the label being added.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Sorry, first of all, you can't designate the cell with gridlayout (that's what I'm sorry about, I don't use GridLayout very often, I usually use GridBagLayout, so I was "imagining" something, but GridLayout is still correct for your purposes), you have to actually fill all of the cells, in order, so you are going to need to order your results, sort by x, then by y, and add labels with an empty String (or a single space) for every cell for which you have no entry.

If you want to do this differently, then look at the API for canvas and use that (but remember to allow the text to have a size, i.e. you will have to multiply the coordinates by something), or use a "null" layout (Google that as I hate that "non-layout" and all newbies seem to insist on trying to use it, but, again, remember that the labels take up more than a single pixel of space), or look at GridBagLayout (which might, or might not, work, depending on how you did it, but I don't think you're ready for this is any case).

Edit: Like I said, see the API docs for GridLayout.

This link will probably be of inestimable worth to you to.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Do you know what a grid is?

If so, then you know why you need the max x and y to create the GridLayout with.

Doing new GridLayout(4,4) creates a grid as follows:

---------
| | | | |
---------
| | | | |
---------
| | | | |
---------
| | | | |
---------

and doing add(label, 2, 2) (or something like that, check the API docs) adds a label to it as follows:

---------
| | | | |
---------
| | | | |
---------
| | |x| |
---------
| | | | |
---------

Now do you understand why you need to get the max x and y and why you need to add all labels to the same panel?

Edit: And, no, I am not going to edit your code for you.

Store the x and y coordinates in a list (or do the query twice) so that you can get the max x and y and then start creating the labels to place in the grid.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Like I said, get the max x and y, and create the GridLayout using that, then add all the labels to that one Panel (using the add method that allows you to designate which "cell" the label should be added to), don't recreate the panel everytime.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because you are doing it completely wrong. setLocation is not what you want. You probably want to do your query, and get the max "x" and max "y" and create a JPanel with a GridLayout, add that to your JFrame (or change the JFrame's contentPane's layout to GridLayout), then add JLabels to that JPanel(/contentPane).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You need to call "setLocation" on f, and there is no reason for your class to extend JFrame, here, especially when you are initiating a separate JFrame. Also, you need to start the Frame in the Event thread (see this). And you should probably do your query before ever instantiating the frame.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Now I see that you are using JME, and not directly instatiating a sun.* class. Points 2 and 3 still apply, however, just you need to look at the JME documentation.

That is as far as I can go know, I don't do anything with JME, myself.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

As you can see I have merged your threads. Please do not start multiple threads on the same topic.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Not sure myself what bci stands for (and don't believe that you need to know), but, considering that the error is coming from sun.com.midp I have a few ideas.

One, are you instantiating an instance of a com.sun class yourself? If so the warning here.

Two, did you maxbe use Java 6 to compile something for Java 5 without using all the necessary options to javac for that (or some other similar version bridging compilation)? If that even might be so see this (scroll down to the "Cross-Compilation Example" and then up to the options description to get a more thorough explanation).

Three, does ListCommandHandler (and possibly even the sun class, and this class may also be part of the sun package, I guess) come from a third-party lib, and if so, is it on the classpath (seemingly not, if so)? It is not part of the Java 6 API, anyway.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Platform independent solutions for an application to interact with MS Office?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

As far as the script tag goes, sorry, URLConnection (and HttpURLConnection) is not a browser. Script directives (such as onLoad) are (AFAIK) not carried out. It is not (again AFAIK) meant for that. If anyone else knows more about that, please feel free to speak up. As far as redirections, check the API docs for HttpURLConnection (and/or URLConnection) there is a method for that (followRedirects() or something like that).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Still closer than Java though. Maybe try a JavaScript forum? Or even better this

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Maybe not, but VB is much closer to it than Java.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

A VB Complaint

This is a Java forum. Go to the VB forum and post a new question there (i.e. start a new thread, do not hijack someone else's).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

See http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html for things to do and watch out for when using Runtime.exec()/ProcessBuilder. It also covers reading the STDOUT and STDERR of the program executed, which is how you'll have to "get your value".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Cross-post

I'm outta here.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Do what? That is simply a statement of what those classes are for.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

From a PM

can u help me with that trapezoidal matter?
really need it..
i have to submit it..
i am math student..
so,i don't know anything about java...

No, we are not here to do your (home)work for you. You wouldn't be given an assignment to program something if you weren't in a programming course, or if a programming course were not a prerequisite for your current course. What your major is doesn't matter. You signed up for the course, you do the work.

We are more than happy to point you in the right direction, but we are not going to right it for you.

P.S. Keep the discussion here, PM's asking for help are usually discarded out-of-hand, or posted for public consumption.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I figured it out how to send SMS through my mobile phone attached to computer but I wanted to use the network instead of device to send that SMS.

Trying to avoid the SMS charge?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay? That tells me nothing. You should not, however, be thinking that I will be writing any part of this for you though. Just so you don't get your hopes up.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, show us what you have.

I am quite sure, however, that the meaning of the "four numbers" is fully described in the homework description, however.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You need a mobile phone attached to your computer, probably, and probably a specific type, or an internet gateway, to which you would probably need a subscription. Check with whoever/wherever you got that "SMS" and "IntelliSMS" class.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

There is another forum here for soliciting developers.

If you are actually willing to do your own work, though, regex to get the "leading text" and the digits, a loop, a counter, and a variable to hold the result, then overwriting the file. Give it a try, post your code, and we will help you correct it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Like I said, it is probably getting redirected (and just because the address shown in the address bar doesn't change, doesn't mean it hasn't been redirected). And, if there is "AJAX involved", then the only thing you can do (without it getting much more complicated) is to print out the contents of the Script tag.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

No one here is going to do your homework for you. Post your attempt at it, along with the compiler messages/exceptions/problem description and any specific question you have about it, and we will help you, though.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I am sorry to say but this community is of no use ..no body gives straight forward answers ..rather all they do is taunt !!!!!

Your real problem is that no one gave you code. I gave you plenty of tips and hints (it is, after all, your (home)work), all you had to do was try. Take one attempt, and post that code, and we will be more than happy to give you further tips, but you have to implement those tips. No one "taunted" you. I simply pointed out that your claim of having produced an excel file was ludricous (with the code provided) and you provided no evidence to the contrary. Instead you continued to feign complete ignorance of the portion of the code you kept wanting provided to you. A piece of code, BTW, that is infinately easier than creating a "real" Excel file, and so should have provided no difficulty to you with the hints provided, given your claim of having successfully created an Excel file.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

With readLine?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

By counting the lines, that's why I mentioned a "counter".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You include the parameter types (i.e. method(int a, int b)) when you declare a method, not when you call it. When you call it you simply provide values (or variables referencing values) i.e.

public int someMethod(int a, int b) {
  // do something
}
.....
int someInt = 2;
int anotherInt = 3;
int answerOne = someMethod(someInt, anotherInt);
int answerTwo = someMethod(1, 2);
// or any combination thereOf
...
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Draw over it with the background color.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Simply creating a Calendar gets you one with todays date, and as long as that "creation" is taking place on the right hand side of an assignment expression, it has also been stored in a variable.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, if you know enough to be able to make a real xls file, then you should know enough to be able to put together the info about readLine, a counter, and contains to be able to do a search inside a file constraing that search between a specific set of line numbers (and help writing to the excel is also not need since you already know how to do so). But, once again, I can almost guarantee that you're still simply writing a text file (or maybe a csv as one step further that can, at least, actually be opened by excel and look like a spreadsheet, although it still isn't an excel file). Give it a try, and post your code, again, and we will help you to correct it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

if this is the convention i would love to follow =)
thanks very much!

Also, if you distribute your app as a jarfile, and place the mysql jarfile alongside it, you can include a reference to that jar in your jars manifest and the command is just "java -jar <yourjarfile>" (assuming the mainclass attribute is set correctly). See http://java.sun.com/docs/books/tutorial/deployment/jar/index.html for further info.

Edit: And that command, not coincidentally, is usually what is recorded in the file associations for jarfiles.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Have you enabled redirects on the URL, as it is probably getting redirected, which URLConnection does not automatically follow.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I should downrep you for that advice. The system classpath is very nearly useless and suggesting to "newbies" to play around with it (even more to the point of adding it if it doesn't exist) is counter-productive to their development. This "advice" is just so wrong on so many levels, but it is not, in its technical form, that far off-base so I can't, personally, justify downreping it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

No it doesn't, that's just you're editor's highlighting. If you don't want to see that then use < scalar(@array) rather than <= $#array

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, if they are communicating over the mod_jk apache module and the associated tomcat protocol (ajp?) there is no difference in the tomcat setup, and of course, if you're asking how to configure apache for ssl, well, an apache forum would appear to be a better place for answers for that.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

No, that should work just fine, since you are saving a "last" value.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

The starting line number and ending line number I would get from user in a textfield that could only contain string but how would i now convert it into a int and then make a search ?

Take a look at the API docs for the Integer class. As far as "making a search", like I said "readLine" (that's a method BTW) with a counter and then String's "contains" method (if looking for actual text).

I am able to make an excel and write in it. coz I have added one more functionality in this , that is to search a string entered by the user in the textfield and then write the lines containing that string in an excel file .
Just help me solve the 1st part.

Just because you name the file whatever.xls does not make it an Excel. And what your code above does is write to a simple text file with an "xls" extension. That is not an Excel file, but if you want to believe otherwise, go ahead. And this talk of "additional functionality" does not support your argument that it is.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Post your modified add method.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, shouldn't you be assigning newNode to neste, instead of the otherway around? (Hint, yes you should be).

Also, those "next" variables should be "neste", should they not?

You should also do Node temp = neste, rather than just Node temp and from that point on you should use temp.neste every where it currently uses next (as I assume you are traversing the list to find the end of it there), and that includes in the assignment at the end.

Edit: The thought behind the method is right, just skewed in the implementation. ;-)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, if the very first "fremst = fremst.neste" results in "fremst" being null, then, either, there is only one item in the list, or the items are not being added to the list properly, but I haven't seen that method, nor how it is being used, so I can't say.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

In your main method you want to define "moonwieght" so you need to do

moonweight = someMethodCall(earthweight)

and "someMethodCall" needs to return earthweight divided by 6. And someMethodCall, of course, needs to de declared to take an argument.

Give it a try and post your new code (complete).

jmguerriero commented: Thanks for your help. +1
masijade 1,351 Industrious Poster Team Colleague Featured Poster

And you now have the "fremst = fremst.neste" completely outside of the if statement, which is the reason you are getting the NPE. That, and the counter, of course, should still be inside the else portion if statement.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Okay. Finished.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

The output with the error:


The code I come to when I press the topmost line:

fremst = fremst.neste;

(There is nothing more around this code. Above is the method I posted in the starting post, belowe a counter; totalt++ , and that's it.)

Uhm, what do you mean "above is the method". This should be part of that method. I.E. you should be using this and "denne = fremst" instead of "denne = fremst.neste". Post that method again, as it is now.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Post the complete error statck trace for the NPE, as well as the code around the line number referenced in the NPE.