Win a copy of Rust Web Development this week in the Other Languages forum!

John Blanco

Greenhorn
+ Follow
since Jan 13, 2005
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 John Blanco

Does the error occur when you don't click the checkbox?
14 years ago
JSF
Just write an action method:

<h:commandButton value="Submit" action="#{myBackingBean.submit}" />

14 years ago
JSF
Yes.

JSF is different than Struts. While it has the same sorts of patterns, JSF is a "Web standard" when it comes to building reusable UI components. Struts is a Web framework.

In fact, Craig McClanahan, the Struts designer, worked on the JSF 1.0 spec. And also in fact, you can use Struts within JSF.
14 years ago
JSF
You don't need a backing bean, but you do need something to hold the value binding. Why are you against the backing bean?

Please clarify what you are trying to do.
14 years ago
JSF
JavaScript's window.open()?
14 years ago
JSF
No.

In fact, faces-config.xml is always included. You would only need to use this stanza to denote *other* files that have faces configuration.
14 years ago
JSF
Simple. Instead of using an <h:outputText> tag, use <h:inputText> instead. The changes will be recorded.
14 years ago
JSF
You might be disgusted with having to put those lines in, but if you use a powerful editor, like Eclipse or NetBeans, you can make a template and not worry about retyping it.

If you're going to do any kind of serious JSF work, you'll want a powerful editor anyway.
14 years ago
JSF
Yeah, it is Swing...sorry, didn't notice the specific forum. :-) Just writing back to say that I found my answer. It's not coding, it's framework. I used the Scrollable interface to specify the required dimensions in my custom component.

I wasn't familiar with this interface, and I'm a little dissapointed that "Java Swing" doesn't cover it. But, they did mention it...and the rest was a piece of cake.
16 years ago
I have a component that needs to maintain a certain height, even when the horizontal scrollbar of the JScrollPane that wraps it appears.

So, it needs to be 32 pixels high, PLUS whatever height of the horizontal scrollbar. Can I take this into account in my getPreferredSize() return? IO tried (32 + getInsets().height), but the insets come back as 0 and are unaffected by the scrollbar.

Any ideas?
16 years ago
Wow...another library. Java stays too far ahead of me. :-) Thanks, worked great!
16 years ago
It seems to me that the ImageIcon class (and Toolkit) are caching images that I load. This is causing me an issue because I am writing a map editor, and when someone updates the actual image of tiles, I want to be able to "Refresh" the screen and reload the graphic.

I had an elaborate image cacher in my code, and drop the cache when I need to refresh -- and now I learn that Java is doing it behind the scenes?

How can I drop the cache so I can redisplay the image? Any technical way, or clever workaround?
16 years ago
The example is contrived...in actual practice, it's useful. I don't see why this code, however, doesn't work? Yes, the Observable is local, but it still registers and then notifies an observer.

It should work.
16 years ago
I feel like such a dunce. What's wrong with this code? The update() never gets called?

import java.util.*;

public class Whatever implements Observer {
public static void main(String[] args) {
new Whatever();
}

public Whatever() {
Observable obj = new Observable();

obj.addObserver(this);
obj.notifyObservers();
}

public void update (Observable o, Object obj) {
System.out.println("Why isn't this called?!?!?!");
}

}
16 years ago