Alex Draper

Greenhorn
+ Follow
since Nov 19, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Alex Draper

There is a couple of methods in the API that are used to select a cell only.
the JTable has a method called
myJTable.setCellSelectionEnabled(true);

22 years ago
Well, we developed the client side as a Swing application (not an applet). Our middle tier consist of different layers, but to make things simple, lets just reference them as the EJB layer. Our EJBs run in Borland's AppServer. Now Back to the client side.
Our client uses the HMVC arch. All the connections and calls to the middle tier are done inside the models. The controllers just handle the events generated by the views and the creation of other child triads in the view. (A triad consist of a view, model, and its controller).
Our views implement the Obersver interface, and our models extend the Observable class, to synchronize the views with its models.
We moved the intensive data gathering to jsps. The app. sends a cmd to the OS, which brings the default browser up and calls the jsp. Our JSPs are handled by TomCat which comes with AppServer.
JavaWorld has an article on HMVC.
You can also look at scoope
Here is a link to scoope, which is an open source HMVC arch. http://scope.sourceforge.net/
22 years ago
I am not sure what are you asking...
If you are asking if it can be done, well it can.
If you are asking if it is a good idea, well it depends.
We implemented a 6-7 tier system using swing at the front end.
We use jnlp (webstart) to deploy to client machines. Middle tier is mostly EJBs but we also run some JSPs in the same app.
22 years ago
I am looking for ways to initialize a GUI screen and make sure that it is initialized only once. In other words, I am looking for examples that accomplish what the following code does.
if (frame == null) {
frame = new JFrame();
} else {
frame.setTitle("Title");
}
I am looking for a more elegant way to check if a gui component has been initialized. I know a Singleton can be a solution, but I am wondering if someone out there has come up with some way to do this without using the "if !null then create" or singleton approach. Anyone...?
22 years ago
Well, one would be the following:
textField.getText().trim().lenght(); //some where in your code

The other would be to add a keyListener to the textField
and check for the following when a key has been Released.
<pre>
public void keyReleased(KeyEvent e) {

if (textField.getText().trim().length() == 0) {
//text is empty
} else if (textField.getText().trim().length() > 0) {
//It has Text!!
}
}
23 years ago
Are you using the same KeyListener for your buttons and the List?
Perhaps, you can check for the source of the event to see who fire the event that you were not specting. (e.getSource()).
I know this is not a real elegant solution, but you can check to see if the source is an instanceof JList or JButton.
If you use an annonimous listener for your components, when the list fires an actionEvent, the button should not see it.
<pre>
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {}
});
list.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {}
});
</pre>
23 years ago
Does anyone knows how to display the pop-up from a JComboBox to display upward?
Thanks
23 years ago