Help coderanch get a
new server
by contributing to the fundraiser

Chris Baty

Ranch Hand
+ Follow
since Nov 23, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Chris Baty

Okay, I figured it out, with help from Eclipse. Problem #1: <followers> are a sibling, not a child. Problem #2: I was confusing nodelist items with element items. Here's the answer:



Hope this helps someone else
Chris>
Hi guys,
I'm trying to parse a simple (to me) XML document with nested nodes that looks like this:


So I wrote a method to parse this file and it works except the number of <followers> is always 5 and the count is always 1.



Any ideas would be appreciated.

Thanks.
Chris>
Hi guys,
I'm working on a JAVA application that can also run as an Applet. The applet reads a text/asci file than makes adjustments based on that read. The Applet runs as expected in Eclipse but when I open the html page containing the Applet it doesn't appear to read the file. I put the text file in the same directory as the Applet:


The security policy file is:


I thought that the browser might be caching the Applet but clearing the cache didn't help.

Any thoughts would be appreciated.

Thanks.

Chris
14 years ago
Hi guys,
I'm working on a keyboard layout for people with special needs so I created my own lay manager:

This Works.

This works okay on macs especially. Here's my layoutmanager:


This has issues but works. Here's my tester:

The challenge is that my layoutmanager seems to screw-up the gridbaglayout so I can't control the exact size and placement of the keyboard. I've tried the gridlayout but it clips the top and bottom keys. Any ideas would be welcome.
Chris
14 years ago

@Override
public void addLayoutComponent(Component arg0, Object arg1) {
// TODO Auto-generated method stub

}
14 years ago
Hi Guys,
I created my own custom LayoutManager, which works okay. But now I want to remove a button when it's been clicked. Has anyone ever implemented removeLayoutComponent(Component)? I'm just looking for an example.
Thanks.
Chris
14 years ago
Hi Ranchers,
I'm designing a virtual keyboard in JAVA. My current challenge is printing out character representations of special characters, like the 'tab key', 'carrage return' and the 'shift key'. I was hoping to use standard characters, like up-arrow, down-arrow, etc, but I'm begining to think that they don't exist in JAVA. Is this correct?

I tried:

Thanks.
Chris
14 years ago
Okay, but I'm not sure where the problem is, if there's a problem that I can correct? I'm guessing it's in here:



Thanks.
Chris
14 years ago
Hi guys,
I just finished my own Honeycomb layout manager and hexagonal button. For convenience, I've been developing on an IMac and it looks great. But on Windows and Linux I get these annoying height and width outlines - which are rectangular. I've tried LayoutManager2 with the same results. Any idea how to get rid of them?
Thanks.
Chris
14 years ago
Once again, I'm an idiot, I took out the getModel code in the button class and everything worked fine.

Thanks again.

Chris
14 years ago
Okay, I'm an idiot sometimes. This is what I got:


I know the mouselistener works because when I click on the button I get letter "A". But I still don't understand how to tell the button to repaint itself.

Thanks for all the help so far.
Chris
14 years ago
Okay, this is my second attempt. Here's what I got in my test program:


Here's my button class:


It still doesn't respond. The other issue I have is eventually these buttons will be keys in a virtual keyboard. If that's the case should I use a MouseListener anyway since I'll need to return the button label?
Thanks.
Chris
14 years ago
Okay, I'm still confused. I added a MouseListener subclass to my JButton class:


How does the MouseListener subclass tell paintComponent() to run again?

Then I did this in the JButton constructor:


How do I add the MouseListener to my test class? I tried:


Thanks again.
chris
14 years ago
Hi guys,
Does anyone know how to create a rollover for a custom drawn button? It's easy if you use Icon but mine is custom drawn. If I implement the mouselistener in the myButton class where do I add the listener. If I implement the listener in the JFrame class how does that class know only to redraw that button? I'm confused.

Any help would be appreciated.

Chris
14 years ago