Brian Duff

Greenhorn
+ Follow
since Aug 16, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
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 Brian Duff

Works ok for me. No exceptions in the Java Console, only the word "init" printed each time I refresh.

Using Firefox 1.0.6 with Java 1.6 (1.6.0-ea-b35).

Brian
18 years ago
Is the dialog set to be resizable (with Dialog.setResizable( true ))?

Brian
18 years ago
Perhaps you don't want the --Select One-- item to be selectable? I had a similar requirement recently, here's one way of doing something like this:

http://www.orablogs.com/duffblog/archives/000177.html

Thanks,
Brian
18 years ago
If you're passing those resources into MessageFormat.format(), you need to use two single quotes, e.g.

19 years ago
In some countries, you can order trial versions of Oracle software on CD from the Oracle store: http://oraclestore.oracle.com.
These aren't quite free: there's a small charge for postage and the medium ($39.95 in the US).
Brian
[ August 23, 2002: Message edited by: Brian Duff ]
[ August 23, 2002: Message edited by: Brian Duff ]
21 years ago
That's just the thing: I tend to avoid putting too much implementation into the inner class itself: you can see in the above implementation that the anonymous inner class is really lightweight. It's sole purpose is to bind two methods in the class to the buttons.
Having said that, if you wanted to, you can easily access information from the enclosing class from inside the inner class (I'm already doing this by accessing the member variables for the button). You can also pass information in via the inner class constructor and with anonymous classes, you can even access variables defined in the same method (provided they are marked final).
I tend to avoid putting too much into inner / anonymous inner classes when I can help it. I've often had to subclass code written by Sun where there is a lot of implementation in an inner class - this makes it very hard to override a small amount of behavior in a subclass.
Brian
21 years ago
Hi,
I'm on the feature team that develop SCM support for JDeveloper....
Sorry we don't have direct support for PVCS yet We are looking into this for future versions.
I assume the problems you're having with JDev and PVCS have something to do with the directory structure or file organization when using PVCS? Could you provide more details on the errors you're getting and I'll see if I can suggest anything that might help.
Thanks,
Brian
OK, I may be biased a bit (well, hell, I *am* biased), but I've worked both ways, and I can honestly say that I'd never, never, never want to go back to using the command line and a plain text editor to do my java development.
Some of the ways that IDEs make my life so much easier every day are (and I'm not just advertising the particular features of one IDE here: most IDEs have all these things and more):
- Integrated debugging (how anyone can cope with the intense fiddly-ness of jdb on a daily basis is beyond me.. well i guess there's always System.out.println() )
- Single keypress compilation (even using Ant)
- Source Control integration (not such a big issue for systems like CVS when you can always edit files depending on how you work, but a big plus for other SCM systems like Clearcase where you have to checkout before editing)
- General project management e.g. organization into packages (I don't miss having 129 MDI child windows open in TextPad and trying to find the files I'm working on)
- Integrated profiling (geez, how many tools do you want to set up your classpath in?)
- Refactoring. Sans-IDE this is a common cause of the 129 MDI child window nightmare mentioned above, coupled with the endless-cycle-of-search-and-replace. In many IDEs these days, I can just move a class or extract a method and wow.. it updates the references for me.
- Code insight. Some people love it, others hate it. To me, it's an alternative to switching to my web browser to look stuff up in javadoc all the time... ok I've pretty much memorized the order of the 11 parameters in GridBagConstraint's constructor these days, but it's always useful to have a reminder for the more obscure APIs
- Clever code editors. The code editor I use not only auto-indents, it automatically inserts closing braces for me and is generally very intelligent about java code and its syntax. I can tell it to sort out all the imports for me (narrow them, widen them, remove usused ones, sort them). I can comment out chunks of code, jump to the java code or the javadoc for the class of a field or variable in my code. Probably again a case of what you're used to, but whenever I switch back to TextPad to fix the odd one-liner, I really notice that I'm having to do all the drudgery that my tool normally does for me.
- Extensibility: if my IDE doesn't do what I want it to do, I can just hack some code together in Java and plug it in. I've got full access to a wealth of utilities for generating and parsing java code.
- UI Editors: OK, these are mostly the weakest link in most IDEs. Having said that, the code that they generate isn't usually too bad. I haven't seen many IDEs these days that generate proprietary code in UI, and if the IDE is half decent, you can freely hack about with the code outside the editor and it'll cope just fine. I use UI editors a lot to get the basics of my UI laid down (and in an effort to forget those 11 parameters to GridBagConstraints' constructor), then I tweak the code a bit in the editor.
...
And all of that's just scratching the surface. At the end of the day, I agree, it's a personal preference thing. There's also a bit of a ramp-up sometimes before you discover enough of the features of some IDEs well enough to get really productive in them. I still believe that most people are more likely to be more productive using an IDE.
Brian
<potential-advertesque-thing>
A lot of our customers have reported that Oracle9i JDeveloper works well on MacOS X with a little bit of tweaking. You can download it free from
http://otn.oracle.com/software/products/jdev/content.html
</potential-advertesque-thing>
Brian
[ August 23, 2002: Message edited by: Brian Duff ]
.. Another thing to note: the memory requirements... Typically, you can comfortably run the IDE in 256MB of memory. However if you're running other applications at the same time (e.g. Oracle database, debugging the built in standalone OC4J), you'll most likely need more. I run with 512MB on most of my systems, and don't often have performance problems with JDev (even when running two copies of it at once). 128MB is a bit on the lean side for most Java IDEs these days.
In 9.0.3, we've also added an extension manager feature so that you can switch features of the IDE that you don't use off: this should hopefully help the memory footprint a little.
Thanks,
Brian
Hi,
We've had a number of reports of performance problems when running JDeveloper at the same time as virus checkers with real time file system protection switched on. If you have a virus checker running and are noticing slow performance in JDeveloper (particularly at startup time), try changing the options in your virus checker so that it does not scan inside ZIP files.
We've fixed this problem in the next release (9.0.3, should be available very, very, very soon ), by simply changing a lot of the .zip files we have on our classpath to .jar files instead...
Brian
This is actually a bug in the Windows look and feel (it ought to behave like this by default)... Anyhoo, here's one way of solving it:
Rather than adding listeners directly to the field, instead change the caret implementation. The caret implementation is a mouse listener and a focus listener. You override the focus listening stuff to select all the text in the field, but in the mouse listening code, you save the current caret position before calling requestFocus() then reset the caret position after focus has been gained.
Something like this:

Should do the trick
Brian
[ August 23, 2002: Message edited by: Brian Duff ]
21 years ago
Hi,
You could build a custom implementation to do this using JDBC and writing a table model from scratch... however, you might want to consider using a component that has already been written to do this kind of thing for you.
In Oracle9i JDeveloper, we have an API known as JClient which provides this kind of functionality: it's a set of model implementations for Swing components (including JTable) which bind the components to information from a database using JDBC.
It might be worth grabbing a copy of JDeveloper (you can download it free from http://otn.oracle.com/software/products/jdev/content.html) and giving JClient a try to see if it fits your needs.
In JDeveloper, the model you're looking for is known as an "Attribute List Control Binding": search for this in the help, or open the help book Developing Java GUI Clients->Creating Data Forms with JClient and Business Components->Working with JClient Models->Setting an Attribute List Control Binding.
(hopefully I'm not advertising too much here... i can provide more details on how to do this kind of thing from scratch too if JClient isn't what you're looking for)
Thanks,
Brian
21 years ago
Of course, that code is fine, but personally I dislike exposing unnecessary public APIs because of implementing listener interfaces at that level. To me, the actionPerformed() method is part of the internal implementation of that class, so I'd prefer not to expose it.
I often use anonymous inner classes and follow this pattern when using ActionListeners:

The above approach hides the implementation from users of MyClass, but gives you some flexibility. You could make doItem1() and doItem2() public if you wanted to provide a way for users of this class to programmatically click the buttons without exposing the buttons themselves. The above example makes them protected, so it's easy for subclasses to change the behavior when the buttons are clicked without dealing with event handling code. You could also make them private.
Another commonly used alternative is to use Actions. Actions are quite a nice way to handle menu items, buttons and toolbar items in a consistent way and are very similar to the Command pattern. See the javadoc for javax.swing.Action for details.
Thanks,
Brian
[ August 23, 2002: Message edited by: Brian Duff ]
21 years ago
Try painting the lines to an off screen buffer, then blitting the buffer to the panel in the paint() method.
You can use the BufferedImage class to do this. Let me know if you need more info.
Brian
21 years ago