Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Jason Dobies

Greenhorn
+ Follow
since Aug 13, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jason Dobies

That shouldn't be a problem at all. You can nest Lists and Maps as deep as you want (or can manage to wrap your mind around).
18 years ago
Just to follow up on Andris' answer to number 2, he is correct, you can create an abstract class by extending a concrete class.
Good luck!
Could you clarify what your question is? I ran the code you supplied and I got four tabs successfully.
18 years ago
Have you tried simply creating a table with one column and assigning that the MultiLineCellRenderer? That'll help simplify whether the problem is in the renderer itself or in the way you were assigning the renderer to the column.
18 years ago
Another way to look at it is from the Object Oriented point of view. An abstract is somewhat like an interface insofar as it defines a "contract" of what the object is obligated to do. An abstract method is saying "the object can do this". Static methods belong to the class, not the object, so there's no custom implementation of a method for a particular object. It's annoying because there have been many times I wanted an interface to implement a static method, but from a pure OO point of view, it doesn't make sense that way.
18 years ago
To elaborate a bit on what Ernest said, you'll hear the terms "lightweight" and "heavyweight" thrown around a lot when discussing these two. AWT is heavyweight, like Ernest said they go down to native calls to render the components, which is often a pretty intensive call. Swing, on the other hand, is lightweight. Rendering most of the components im memory, Swing is typically much faster (I say typically because a lot of it still depends on code design).
My understanding is that Swing started as a project internal to Sun, it was a bunch of developers who just pieced together cool components from AWT components. It took off from there.
18 years ago
I'm pretty sure the answer to that is none. You might be able to buffer the image in a separate thread, but as far as repainting or changing the controls, you'll get weird (for lack of a better word) results appearing in the GUI.
18 years ago
In theory you can join the threads using Thread.join(). I've never tried it, but pretty soon we're looking to put quite a bit of our database tracking code into separate threads so let me know how it works out for you.
18 years ago
I agree, I was taught to start with the database and work your way outward from there, with the GUI design being last. I was working with text-based testing on the database and network until pretty far into the project, which helped minimize the places bugs could surface. But that may be just my style, I know a guy who did the GUI first and saved the database locking until the end.
Good luck!
The timeframe is pretty dependent on your amount of Swing knowledge. I had had quite a bit of Swing experience prior to the exam, so I didn't have to take the time to learn how everything works. If you haven't worked with Swing before, you might want to take a little time to get familiar with it, especially working with JTable. The LayoutManagers can be tricky in the beginning and you'll save some frustration with the exam if you get some base knowledge of them before starting.
Good luck!

First of all, Let me ask you guys a question. When you implement the local mode, do you call lock and unlock method on the Data class in your GUI?
I do in the local mode.


Even in local mode I don't directly make these calls from the GUI. To me, that is logic that shouldn't exist in a GUI, local or remote. I ran the local GUI on the same business logic classes the remote GUI used. Whether or not the DB was local or remote was transparent even at the business logic level.
The Struts purists will probably crucify me for this, but the easiest way would be to use <%= ordernumber %>.
18 years ago
Try subclassing DefaultTableCellRenderer (for example, HeaderCellRenderer) and simply add something like the following:

Then assign that to the header row:

That should allow the renderer to perform whatever default rendering operations it wants while you simply override the alignment. Assigning it to the table header row should result in all of the formatting that makes it look like a header.
18 years ago
This was the only rule in the instruction file that I blatently violated. I couldn't bring myself to expose the inner workings of the database across the wire, so I hid most of database method calls server-side and exposed business logic through RMI. I wasn't penalized for doing so, I just made sure to explain my choice in the design document.