| focus gained received twice for the same button |
|
 |
Index ‹ java-programmer
|
- Previous
- 1
- Linking native libraries in Win2KHi there,
I'm trying to get some 3rd party "Kit" working and I'm struggling
with a java.lang.UnsatisfiedLinkError.
What I use is IBM's Visual Age 3.5.3 (JDK1.2.2) and the library in
question is IBM's OnDemand 7.1.0.7.
What I did was to copy all the DLLs and INIs etc. from the
"IBM\OnDemand Web Enablement Kit" into my WINNT\system32 folder -
where they should be found by any app, because it is listed in my
PATH.
However, I get an UnsatisfiedLinkError and I don't even know which
library it is actually looking for, as the stack trace
java.lang.UnsatisfiedLinkError
java.lang.Throwable()
java.lang.Error()
java.lang.LinkageError()
java.lang.UnsatisfiedLinkError()
int com.ibm.edms.od.ArsWWWInterface.initialize(java.lang.String,
int)
int com.ibm.edms.od.ArsWWWInterface.initialize(java.lang.String,
int)
int com.ibm.edms.od.ArsWWWInterface.init(java.lang.String, int)
void com.ibm.edms.od.ODServer.initialize(java.lang.String,
java.lang.String)
does not really help and I found when trying to catch this and dump
the name of the library was "null".
I somehow can't believe I'm the first one to struggle with this.
Any help is greatly appreciated.
Thanks,
Martin
- 2
- addRow error when further editing is doneHi All,
Quick question (hopefully an easy answer).
Using JBuilderX--a GUI with a JTable component, I click a button
calling a method that adds a new row to a TableDataSet table in the
Database. This code in a datamodule class method:
openIMTable();
DataRow item = new DataRow(imTable);
item.setString("COLUMN1", "SOME TEXT");
imTable.addRow(item);
Returning to the GUI, the row is visually added, everything is fine.
The new row is highlighted in the JdbTable component. I click on an
empty column field in the new row and type some info--press Enter and
get the following error message: "Unable to set value because could
not post or leave row 0". If I select a different row with the mouse
and then reselect the "new" row I can add other fields with no
problem.
What am I missing?
TIA
Mark
- 2
- Multiple server access jdbc/servletIf I have an applet, which is donwloaded to the local machine from server
A, and calls a servlet on server B.....can that servlet, via JDBC, access a
database on server C, assuming each of server's A, B and C are on separate
machines with separate URLs ?
Thanks, Ike
- 2
- algorithm - how to estimate time to completeNot a problem as such, just a question about estimating time for producing
algorithms.
I recently had to write a class with a method that was to convert digits
(int) into their 'word' representation.
To begin with, converting say, 234, into "two three four", was easy enough.
But the method was also to 'sound english'
So, 234 now had to be converted to:
"two hundred and thirty four"
Some other examples:
"six million, three thousand and fifty six"
"six billion and one"
"eight billion,six million, three thousand, fourhundred and fifty six"
(like the way a person may write on a cheque underneath the digit amount.)
I wrote such a method. (which was actually a little more invoved than this
as it supports currencies, floating point number etc;) But, only after badly
underestimating the time involved for me to do so. There were were a few
elemenst about it that were not so obvious until I sat down to write it. I
ended up scratching a lot of stuff down on paper, and wrote it 3 times till
I was happy with it.
I have two questions here:
What is the best way to estimate time for rather small tasks like this? How
to you determine if a job will take an hour, a day, or a week? I know it
seems like a silly question - but I am just keen to see what sort of
responses come back from it.
Secondly, how long do you think it would take you to write a method such as
this? Personally, I allowed an hour and a half, and, like I said, was badly
mistaken. I know I took longer because I trivialised the problems till I ran
into them in live code, but still, it took way longer than I expected. (It
took me a whole day and a bit of the next day)
TIA
- 2
- constructor inheritance/overriding?If I have a base class with some over-loaded constructors
that perform significant work before calling the
"main" constructor, what is the best way of achieveing
the same set of constructors in a sub-class?
e.g.
class B {
B(A a) {
... lots of stuff ...
}
B(D d) {
this(get an A from the d);
}
B(S s) {
this(get an A from the s);
}
}
class E extends B {
E(A a) {
super(a);
addition 'E' specific code
}
}
How do I implement E(D d), and E(S s)?
As I understand things, constructors are not inherited (unlike C++),
so I do need an explicit implementation of each constructor. But the
"obvious" minimal implementation:
E(D d) {
super(d);
}
would call B(D d), which would then call B(A a).
Thus the extra 'E' specific code would NOT be called.
I don't (unless I must) want to expose the inner workings
of the other constructors in 'B', for reasons of data hiding
and code maintainance.
This question must have arisen before, but my googling failed
me.
Anyone have a solution?
BugBear
- 7
- A bafflement moment on enumI have written enum code that works, but suddenly I had a sinking
feeling that it has no business working. I did a little disassembling
and sorted out the mystery.
let's say I create an enum with method next().
Then I override the next() method with custom code in the various
enum constants.
These methods live in anonymous inner classes of the enum (though
oddly they decompile as static).
Then I do something like this:
Breed d = Breed.DALMATIAN;
d.next();
How on earth does Java know to use DALMATIAN.next() rather than
Breed.next()?
The answer is that d contains a reference to the DALMATIAN inner class
that EXTENDS the Breed enum class as well as being an inner class of
it. So the next() method overrides the one in the Breed class.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
- 8
- IDE for JFSWhat IDE you would recommend for JSF based J2EE development using JBOSS
AS.?
- 10
- Castor XML Question: How to ignore wrapping elementsI have an xml file that looks something like:
<Response>
<Invoice>
<PrimaryKey>239</PrimaryKey>
<OrderTotal>5893.03</OrderTotal>
</Invoice
</Response>
I am trying to map <Invoice> to my Invoice.java class. How do you get
Castor to ignore the outer <Response> tag? I could always do
pre-processing, but I would like to know if it's possible to do this
in the mapping xml file.
Thanks,
Ankur
- 11
- How to start default browser when clicking on a labelHi,
I was wondering how I can implement a JLabel that references to a http link.
When I click that label the default browser should open and loading the webpage.
This is for a JDialog 'About' window.
I've seen this several times, but I've no idea how to implement this with
Java/Swing.
Regards,
Helmut
- 14
- exe within a jar fileI want to package and run an exe within an executable jar file. I've
tried using the getClass().getResource("relative/exe/location"), but
receive the following error when running the jar
java.io.IOException: CreateProcess:
jar:file:\E:\test\TestProgram.jar!\myexe.exe error=2
this occurs when I run the following code:
Runtime rt = Runtime.getRuntime();
Process proc =
rt.exec(this.getClass().getResource("/myexe.exe").toString());
I would appreciate any help or suggestions on the subject. We've
considered extracting it an running it from a temp location and
cleaning up the directory, but we would like to avoid this. Thanks!
- 14
- jikes dependenciesHi,
I try to find all the dependencies of a class file (which are the
class to recompile when I modify just one java file).
According to Jikes website, "C depends on D if and only if the
constant pool for C contains a reference to D".
So, for a particular class, E, I found with Jikes the following
dependencies :
A, B, C, D.
At the same time, I used the BCEL library from apache to have a look
at the constant pool and I just find references to the class A, B and
C.
The class C is a parameter of one method of my class E and the class C
implements the interface D.
I understand why the class E depends on the class D.
Is the Jikes assertion incomplete or should I understand "C depends on
D (and all its ancestor/interfaces) if and only if the constant pool
for C contains a reference to D" or maybe even "C depends on D (and
all its dependencies) if and only if the constant pool for C contains
a reference to D"??
Thanks for your help.
Eric Deshayes
- 14
- Not debugging?Phlip wrote:
>
> Duane Bozarth wrote:
>
> >> The define "legacy" as "requires debugging".
> >
> > That's a bizarre (at best) definition of "legacy"...
>
> That's why Greg didn't understand why I used it like that.
I didn't either (and still don't) because it has nothing whatsoever to
to w/ "legacy" or not...
> Me: Strive to never debug.
>
> Greg: What about blah blah blah.
>
> Me: You are using something that you can't design
> fresh from scratch to resist bugs. So you must
> run the debugger more often than greenfield code
>
> Greg: It's not "legacy" it's embedded blah blah blah
In that sense everything is "legacy" -- I can't redesign a commercial
compiler, either.
...
> Just don't leave the emulator out of the loop. Greg implied using it would
> slow down the tail end of development.
At some point in most embedded systems, that <is> true...you get to a
point at which the depth of emulation required isn't worth the effort
that would be required. Once at that point, reverting is rarely
productive use of resources.
- 14
- struts action quiestionHello,
I have a short question concerning struts action context stack. I have 3
views. View A, B and C
To view C, I can get from view A, or B. In view C I have button "BACK",
Whenever I click BACK button, I want to go back to page that called view C
(A od B).
Is there any way to do it (remember calling view), or I have to implement my
own context stack mechanizm ?
thank you,
fera
- 14
- [ANN] Scala 2.5.0-RC2 releasedWe are pleased to announce version 2.5.0-RC2 of the Scala distribution:
| Scala smoothly integrates features of object-oriented and |
| functional languages and is fully interoperable with Java |
It fixes several bugs found in RC1.
http://www.scala-lang.org/downloads/changes.html#v2.5.0-RC2
Other release candidates may follow this version depending
on bugs reported by the Scala community (no changes/additions,
only bug fixes!); the final release (aka. 2.5.0-final) is
planned in 1-2 weeks.
Bye
-- Stephane
- 16
- (J2ME) CLDC1.0 and equalsIgnoreCase?When I try to compile a class using this method under WTK2.5 with a
CLDC1.0 target, I get:
cannot find symbol
symbol : method equalsIgnoreCase(java.lang.String)
location: class java.lang.String
The source compiles fine under JRE 1.5 and I can't see any mention
that equalsIgnoreCase was only added in CLDC1.1. Is the method not
available or am I doing something wrong? Thanks.
|
| Author |
Message |
news.verizon.net

|
Posted: 2004-4-14 23:09:00 |
Top |
java-programmer, focus gained received twice for the same button
I have two buttons in a JPanel (default FlowLayout), which is nested in a
BorderLaout panel's SOUTH slot. The panel implements a FocusListener, and
I'm using the focus gained event to as follows:
/**
* 1) To ensure the next widget, if it has selectable contents (i.e.,
like a JTextField),
* has it's content completely selected.
* 2) To update the status bar with any tool tip text.
*
* @param event
*/
public void focusGained(FocusEvent event)
{
Component c = event.getComponent();
// debug
getStatusHandler().setStatus(c.getClass().getName());
// displayToolTipText( (JComponent) c);
if(c instanceof JTextField) {
((JTextField) c).selectAll();
}
}
For some reason, when the last button in the panel has the focus, it takes
two tabs to get it off. While there is no visual indication after the first
tab as to where the focus is, the debug trace I put in is displaying that
the Component in the focusGained method is still a JButton. The only
modification I made to the KeyboardFocusManager is to add the ENTER & shift
ENTER keys to the forward and backward traversal keys.
Thanks in advance,
- Eric
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- How to get all tables without schema?Hi all!
How to get all tables without schema from DatabaseMetaData on Oracle 9?
I have tables:
a,
b,
mdsys.a,
mdsys.b
How to get "a" and "b" tables only?
I try to get it the follow code, but this code return empty resultset.
String tableTypes[] = { "TABLE" };
ResultSet rs = databaseMetaData.getTables(null, "MDSYS", "%",
tableTypes);
Where my mistake?
thanks
- 2
- Struts RequestProcessor override...I have subclassed the Struts RequestProcessor (Controller) in an
effort to centralize some of my business logic. On occassion I will
need to override the original service request with a new forward
action. Any idea what method call(s) I need to make?
Thanks for any help,
schmen
- 3
- Improving Jmeter - User Agent Switching for HTTPHello Testers
Many current dynamic WEB systems with XML/XSLT can customize page
output by detecting what type of user is accessing page. It can be
recognition of IE and FIREFOX, plain text page for PDA or no javascript
menu for search engine. Because this different templates have different
resource needs for correct testing is neccesery to implement EASY WAY
to change/define User Agent Switching in Jmeter.
---------- Implementation Notes ------------------------
1. Allow Custom User Agent
Be shure then we can change user agent strings in both HTTP probes by
adding User aggent header in current custom hedaer module.
2. Impelemnt changing by GUI
Chris Pederik author of "User Agent switcher" for Firefox and Mozilla
agreed to share with us logic for generating various user agent headres
emulating different Web browsers and utilites.
Code is in Javascript and XML under at
http://www.chrispederick.com/
There is also contact infos for Chris.
---------------------------------------------------------
The best actual source of warious user agent strings is:
User agent Strings
http://www.pgts.com.au/pgtsj/pgtsj0208c.html
List of Robot Agent Strings:
http://www.pgts.com.au/pgtsj/pgtsj0208d.html
Ing Rudolf Kutina
Practical tester
Prague
Reply
- 4
- Users onlineHi,
How can I keep track of users online in a non web j2ee aplication.?
I thought using a Statefull EJB , one for each user created when the user
login and destroyed when he logs out.
Another option is to keep a table in the DB tracking this , maybe a CMP ?
Any sugestion ?
Thank you
- 5
- differences between all the GraphicConfigurations?I'm looking through this example
http://java.sun.com/j2se/1.3/docs/guide/2d/spec/j2d-awt.fm6.html, and I
cannot understand the difference between the different
GraphicConfigurations. When the frames come up on my screen, I get eight of
them on the screen, and the only difference I can tell between them is the
pxlfmt in the GraphicsConfiguration.toString(). What is the difference
between them?
I'm trying to figure out which GraphicsConfiguration I need to draw to if I
want to do some drawing on multi-screened application? Do I have to draw to
all of the GraphicsConfiguration's? For multi-screen systems, I hope I
don't have to draw eight times the number of monitors. Or do I not
understand how to draw to multi-screen devices?
Thanks.
- 6
- Street address parsing APIDoes any one know any Java API package that can parse/de-compose a
street address string into detailed components? For example:
----------------------------------
Example #1:
Input: 123 E Main St., Atlanta, GA 01234
output:
Street Number: 123
Street Pre-Direction: E
Street Name: Main
Street Suffix: St
City: Atlanta
Zip: 01234
-----------------------------------------------
Example #2:
Input: #3 Allen Court, 45 Main St. Boston, MA 02345
Output:
Apartment #: 3
Apartment/Building name: Aleen Court
Street Number: 45
Street Pre-Direction:
Street Name: Main
Street Suffix: St
City: Boston
Zip: 02345
--------------------------------------------------
Thanks you.
- 7
- How to get line number of current cursor?I try to get the line number of current that cursor is on from the
JEditorPane.
I found method getSelectionStart() and getSelectedText(), but it not
has the getSelectedLine() or ...
So, anyone know how to get the current line number that cursor is on.
Thanks.
- 8
- Funny video :)http://rozrywka.yeba.pl/show.php?id=1029
:) Funny Sports Bloopers :)
- 9
- "error: cannot read:" (use the list file name written in a file)Hello:
When I compile the java source using command
javac javatest\kernel\*.java
it's perfectly work
but I have a lot of source code and distribute over many directories
So I write a file that contains:
javatest\data\*.java
javatest\kernel\*.java
...
names this file as "makefile.txt"
and use the command
javac @makefile.txt
but I got a error
error: cannot read: javatest\data\*.java
please help me
Eric Chen
- 10
- JBoss: strange jndiName?Hi,
I've a strange problem: I deployed several EJBs and in the JMX-Console
it looks like that:
jndiName=local/BlbRcZlUserReportBean@30473856,plugin=cache,service=EJB
jndiName=local/BlbRcZlUserReportBean@30473856,plugin=pool,service=EJB
jndiName=local/BlbRcZlUserReportBean@30473856,service=EJB
my ejb-jar.xml:
..
<session >
<description><![CDATA[Die User-Session, die die Reports
speichert]]></description>
<display-name>Name for BlbRcZlUserReportBean</display-name>
<ejb-name>BlbRcZlUserReportBean</ejb-name>
<local-
home>de.blb.rczl.onlinereports.ejb.BlbRcZlUserReportBeanLocalHome</
local-home>
<local>de.blb.rczl.onlinereports.ejb.BlbRcZlUserReportBeanLocal</
local>
<ejb-
class>de.blb.rczl.onlinereports.ejb.BlbRcZlUserReportBeanSession</ejb-
class>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>
</session>
..
my jboss.xml:
...
<session>
<ejb-name>BlbRcZlUserReportBean</ejb-name>
<local-jndi-name>BlbRcZlUserReportBeanLocal</local-jndi-name>
<method-attributes>
</method-attributes>
</session>
..
Any hints?
Regards,
Sascha
- 11
- actions on JPanel objectsI have a main project GUI with tabs on it. these tabs have JPanels
with various JComponents on them. The JPanels are all made in seperate
classes that extend JPanel. the point of that is to make my code a
little cleaner. All the components in JPanel are private. However, I
don't know how to add an ActionListener to buttons and other components
on the JPanel and recieve these actions in the main project rather then
the JPanel class. Help please? i would appreciate it
- 12
- He Fucks His Neighbor's Mom And Her Tits Are Monstrous! Just few link on some movies...
All just for you...
Download
>>>>> http://download-video.12w.net
>>>>> http://world-sex.urllogs.com
>>>>> http://video-sex.12w.net
CLICK FREE DOWNLOAD VIDEO PORN...
L
I
C
K
T
O
W
A
T
C
H
V
I
D
E
O
P
O
R
N
D
O
W
N
L
O
A
D
F
R
E
E
.
.
.
W
E
L
C
O
M
T
O
M
O
V
I
E
S
P
O
R
N
D
O
W
N
L
O
A
D
.
.
.
- 13
- 14
- JWindow Handle
Peace be unto you.
Make sure to pass jawt.lib (C:\j2sdk1.4.2_04\lib\jawt.lib) to your compiler.
The code for MyCanvas.java is in C:\j2sdk1.4.2_04\include\jawt.h
Look in C:\j2sdk1.4.2_04\include\win32\jawt_md.h to see more instructions on how to obtain a window handle.
For instance, struct jawt_Win32DrawingSurfaceInfo can be manipulated like the following.
HWND hwnd = dsi_win->hwnd;
HDC hdc = dsi_win->hdc;
<code>
javac MyCanvas.java
REM generate MyCanvas.h
javah -jni MyCanvas
REM compile c file
REM include headers from java, compile to object not executable
gcc -g -O2 -c -IC:/MinGW/include -Ic:/j2sdk1.4.2_04/include -Ic:/j2sdk1.4.2_04/include/win32 -g MyCanvas.c
REM jawt.lib is treated like an object;otherwise it will complain about not finding get awt
dllwrap -IC:/MinGW/include --output-def MyCanvas.def --add-stdcall-alias -o MyCanvas.dll MyCanvas.o C:\j2sdk1.4.2_04\lib\jawt.lib -lgdi32
REM need jawt.dll in path not class path; -Djava.library.path gave me problems;otherwise get unsatisfied link error
set path=C:\j2sdk1.4.2_04\jre\bin;C:\WINDOWS\SYSTEM;.;C:\WINDOWS
java MyCanvas
</code>
By the way there is the FindWindow function. (Microsoft Q124103: HOWTO: Obtain a Console Window Handle (HWND))
Have a Good Day.
-- References
Mumit Khan
http://www.xraylith.wisc.edu/~khan/software/gnu-win32/
Davanum Srinivas
http://www.javaworld.com/javaworld/javatips/jw-javatip86.html
- 15
- new line in a Label or a ButtonIt is possible, in awt, to have a phrase divided in more of one line? I
want display in a Button this:
save
with
name
and not this:
save with name
But if i write:
Button b=new
Button("save"+System.getProperty("line.separator")+"with"+System.getProperty("line.separator")+"name");
I see only strange characters, and not new lines.
|
|
|