masijade 1,351 Industrious Poster Team Colleague Featured Poster

What is a spreadsheet except a glorified 2-dimensional array. Sorry, but I can help no further.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Take this

given the data

int[][] data = new int[][] {
    { 1, 2, 3 },
    { 4, 5, 6 },
    { 7, 8, 9 } };

You would do the row/col totals as follows:

int[] colTotals = new int[data.length];
		for (int i = 0; i < data.length; i++) {
			int rowTotal = 0;
			for (int j = 0; j < data[i].length; j++) {
				System.out.print(" " + data[i][j] + " ");
				rowTotal += data[i][j];
				colTotals[j] += data[i][j];
			}
			System.out.println(rowTotal);
		}
		for (int i = 0; i < colTotals.length; i++) {
			System.out.print(colTotals[i] + " ");
		}

Now modify that principle to use with POI, which is exactly the same, simply replacing i/j with the row/column index and of course cell methods instead of array access. Now, that is much more than I usually give as code, so the rest you are going to have to do.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Hi.
Actually i am generating the excel report for an employee total efforts spent in an organistaion.
so for that i need to cal row wise total and column wise total. i calculated row wise total and i need the help in calculating column wise total.
Can u pls figure it out. Thanx.

Uhm, so transpose that logic?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Uhm, read each cell in the column and total them?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Start typing in a text editor.

Create a class that has all of those method signatures listed and then try to make sure that they do what they seem that they should do.

We are definately not going to write it for you. We won't even write a skeleton of the class for you, as that is, essentially, what the assignment text has done for you already, it just hasn't wrapped the thing in braces.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Lots, what are yours?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

extend JComponent and do you're actual drawing by overriding paintComponent

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Here

for(int h=0; h<numMatrices; h++) {
    int numRows = 13-h, numColumns = 12-h;
    matrix[h] = new Matrix(numRows, numColumns);

you are varying the "sizes" of the matrices using the index into the Matrix array.

Here

int nRows = A[0].numRows, nColumns = A[0].numColumns;
for (int i = 0; i < A.length; i++)
    for (int k = 0; k < nColumns;k++)
        for (int j = 0; j < nRows; j++)

you are getting the dimensions of the first (and therefore largest) matrix and using those dimensions during your processing for all the matrices, therefore incurring the ArrayIndexOutOfBoundsException on the last indexing attempt on the first row of the second matrix since it will be one smaller in all dimensions than the first was.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Otherwise, what you need is the JDBC-ODBC Bridge (Google that), but the only way to "create" one from your program would be to first manually create an empty one yourself and then simply "file copy" that to "create" others.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Don't do it through MS Access. If you a need a "simple" db that you can use "anywhere" (which you can't with MS Access, BTW) use JavaDB/Derby and distribute the derby.jar with your app.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Closing this multiply resurrected zombie now.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What is wrong with reading the documentation of the IDE?

In any case, closing this three year dead zombie.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

ok all i have to do is when i click the "search button", it will performed the query statement..and all the resulted images will be displayed in the yeahFrame() class or the second class

Well, I can see you know how to add components to a Gui, as you've done that. And, I can see that you know how to read a Blob from the DB, since you do that. So, I assumed, that all you needed was help on how to go from the images binary contents to an Image. Well, as I said see the API docs for ImageIO.

..how do i do that??

Not by waiting on us to do it for you which is what this comment makes it look like you're doing.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Read this completely, thoroughly, and carefully and implement all of it's suggestions.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

See the API docs for ImageIO.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Another who thinks they'll learn by not doing anything?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Design, code, test, deploy.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Then the answer was RandomAccessFile.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

By arranging them properly (GridBagLayout with proper constraint settings and properly designed components will let you do nearly anything) and letting the layout manager do it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

:sigh: Just see the specs

masijade 1,351 Industrious Poster Team Colleague Featured Poster

If you need a very precise layout, you can do setLayout(null) and then use the setBounds method for coordinate positioning.

No, that will not give a "very precise layout". That will create a very brittle layout that will "break" as soon as the font is changed, or the app is run under a different display size, text size, os, whatever, as most of the components sizes will alter, at least slightly, under those conditions. At the very least it will take alot of work by the programmer to take all the variables into consideration, and resizing will be a real pain. The layout managers manage all of this for you. The "null" layout is not an option, except in very specific instances.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because the package for "B" is "pkg" so it will look for "B" in "pkg", of course.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

The default layout option for JPanels (which you use in your class) is FlowLayout with a default flow of left to right, so, as Ezzaral says, use a different layout.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Since you would assume that at least 90% of the time you will be able to reserve your designated port, the "loop" will only come into play, at most, 10% of the time. Whereas if your "advertising" the port, the client would have to make two connections every time.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That's why he should be using some sort of "start" protocol in the first place. Either the client or the server blindly expecting a successful socket connection to mean that they have the "right" connection is bad design in the first place.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

In that case the "current class version" would be "none", would it not. But how I really should have said it is "the date time stamp of the current compiled classfile associated with that source file".

And it wouldn't be found in the "source directory", it would be found "on the classpath". Now, that might, and might not, be the same place, depending on the setup.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because the compiler you used is setup to search the source directory, as well as the classpath, and compile those items from the src dir if they are newer than the current class versions.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

See the API docs for and Google RandomAccessFile.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

IOW, Someone else already gave me the code, but I can't defend it to my instructor.

Try writing some code. Try doing your homework and you might actually learn something.

tux4life commented: I agree :) +8
masijade 1,351 Industrious Poster Team Colleague Featured Poster

IOW "give me teh codez". No.

Post your code here along with all compiler messages and/or exceptions as well as a descritpion of what it is suppossed to do and what it actually does and exactly how they differ, and we will help you to correct your own code, but you are going to have to do it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Check out multicast if you really feel the need to advertise. Note that this will probably only be a "local network" feature as most gateways will probably not propagate the signal.

Better, however, would be to simply have a range of, say 5 or so, ports and simply have the clients try one after the other until they get a connection (or not if the server is down or there is a network problem).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

How Ajax will be used in java ?

Since I'm not sure if this question is a question or just a spam intro I'll leave the question and just remove the spam link.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Don't use = (or !=) to compare Strings. use "str.equals(str)" (or !str.equals(str)).

Edit: IOW, leave the while condition checking the "null" status (thereby catching the EOS).
And, as the first line of the loop check the String's value with the equals method and break the loop when that value matches a specific "kill" value.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

"key" is an integer, not a String.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because you won't get "null" until the server closes its end of the connection. Which you don't want, I would assume. I would assume you want to continue using the same connection, right? So the server is going to have to send some extra String, or something, to signify that its finished, and the client will have to check for this String and break out of the loop once it gets it (without showing that String to the user, of course. Or, you could simply use the last line of the menu as the "key" to break out of the loop, if it has a fixed, set text.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Closing this year long dead zombie.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

when you implement an interface, you'll have to implement all methods in your class.
like if interface A has methods A1 and A2, your class should implement both methods even if you don't use any of them.

Abstract classes, you may override the methods that you want to customize for your class

Not when those abstract class methods are also abstract (which the OP explicitly stated they were).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, I have no idea what you actually said, nor what the interviewer actually asked (not just your recollection of your interpretation of the question), nor how, exactly, the interviewer expressed his "dissatisfaction" with the answer, nor what, exactly the interviewer was aiming at with the question, so I can't say.

If you want to know the complete answer see the JLS and Google.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You can implement multiple interafaces but you can extend only one class. So be careful with abstract classes in the first place and the only reason to use an abstract class in the case listed above is when there is some common, non-trivial, implementation to be considered as well.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I'm sorry but what part of

Only level 0 dumps are allowed on a subdirectory

do you not understand?

I can only assume "$now" references a directory, of course.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Try FileLock, but no guarantees, of course.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

One way to do this, will be to embed it in html code. I.e.
String helloStrng = "<html><font color=red> Hello </font></html> World"

Not in a PDF document, which this is what this was about.

Closing this two year dead zombie now.

P.S. that is still nothing more than doing hello in red then world in black, which was already suggested.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You are confusing things. An enum is static, it always is. Just like "one" in my example above. That statement that says it is "an instance of enum" means that that static member is an enum, and not a String, or Integer, or whatever. In exactly the same way that "one" above is an instance of Integer. It simply means that "one" is an Integer and not a String, or Enum, etc.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
public static Integer one = new Integer(1);

one is a static member that is an instance of the Integer type. Same same.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Not folder list. See your project's properties/preferences and search for the library list.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Oh, thtop it!. I'm blushing!

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Uhm name + ".txt" , maybe?

Why do you think I showed you how to do String concatenation?
Not as though you are extracting anything though.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Add derby.jar to your project's library list. And that is as much as I will say about it as classpath discussions always become ugly on a forum. Find a tutor and/or read the IDE documentation thoroughly and read everything you can find about classpath.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Uhm, what do you mean "extract the part".

To concatenate Strings you use "+" of course. I.E.

string1 + string2
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because in the second case the compiler knows that b will always have a value, but it does not know that in the first version (the compiler does not compute expression values).