 |
 |
Index ‹ java-programmer
|
- Previous
- 1
- java access to USB MAC OS XI have a simple requirement at this point an Apple MAC OS X - that is
to detect the presence or lack of a USB device from java.
I have read about JSR 80, javax.usb, jUSB and all indicate not
available in Mac OS X.
I also know that in linux, I can do a "cat /proc/bus/usb/devices" and
get a list of devices connected to the machine.
Now Mac OS X is "linux" - yet there doesn't appear to be /proc/dev/...
etc.
Any suggestions on how to get the presence or lack of a USB device
from java on Mac OS X??
- 1
- JProgressBar bar not showing up till completeHi thanks for reading.
Im sure the answer to this is simple, it just eludes me at this point.
Im tring to use a progress bar to simply show the progress of 55 files
being created and saved to disk. However when I use the JProgressBar
in my code, it only shows up when the task is completed... Obviously I
need it to be shown updating the entire time, seems like im missing
something pretty basic.
heres the code for your perusal, the updates occurs later in the code,
but since its not showing up until it is completed I believe the error
is here + Thanks! :
//start up progress FRAME
JFrame jfrProgress = new JFrame("Creating Movie...");
Container contentPane = jfrProgress.getContentPane();
SpringLayout layout = new SpringLayout();
contentPane.setLayout(layout);
//set up progress BAR
JProgressBar pbProgress;
pbProgress = new JProgressBar(ISTARTFRAME, iFinalFrame);
pbProgress.setValue(ISTARTFRAME);
pbProgress.setStringPainted(true);
pbProgress.setString("Step 1 - Creating Files...");
pbProgress.setSize(500, 40);
//add progress bar to frame
jfrProgress.getContentPane().add(pbProgress);
//display frame
jfrProgress.setLocation(400, 300);
jfrProgress.setSize(250, 100);
pbProgress.setVisible(true);
jfrProgress.setVisible(true);
- 2
- 6
- J2ME . How do I start?Hello,
I need to write an application for MIDP 2.0 phones. Once I write the
application, will it work on every phone that supports MIDP 2.0? What is
the best way to get started? Which tools should I use? Any online tutorial
videos or good books? Thanks a lot.
T.I.
- 6
- help me finding pathHi,
How to find the Path String from jrePath to jawtPath?
Thanks,
Sri
--
Message posted via http://www.javakb.com
- 6
- GeronimoIs there anyone who has successfully run this
application server under freebsd? I have problems
with rmi, but since nobody answered my other post
I suppose nobody else came across the same problem?
- 6
- Example of simple SOAP web-service on Resin?Hi group
I want to run my simple web service app on Resin. (I currently run it
on JBoss 3.2.3)
Does anyone have a simple example of how to do this with the
configuration of web.xml etc.?
Thanks in advance
-asciz
- 6
- What IDE for Java do you use?nospam wrote:
> Hi...All,
>
> I recently downloaded eclipse IDE with myeclipse web editor
> (myeclipseide.com) . I did not see any views on it in this thread. So,
> would be interested to what your thought are on
> eclipse+myeclipse(struts, EJB....)
The views in Eclipse aren't initially as elaborate as those under WSAD,
but you can change that;
http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse.platform.doc.user/gettingStarted/qs-02e.htm
and
http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse.platform.doc.user/gettingStarted/qs-02e.htm
are a good start. Look on sourceforge.net for a variety of plug-ins so
you can enhance your IDE even more. Eclipse Colorer may be of help:
http://eclipsecolorer.sourceforge.net/index_profiler.html and
http://sourceforge.net/projects/eclipsecolorer.
- 8
- stability problems under eclipse on amd64 platform
I would like the following patch file to be tested and committed to the
java/jdk15 port until patch 6 is released on FreeBSD. This patch has
eliminated crashes for me and has made a significant difference in the
stability of eclipse.
Cheers,
Sean
- 8
- Problem accessing Windows clipboardHi
In my java program I have a class which contains some code which accesses
the Windows clipboard.
When I use this class in a standalone application (JFrame) I can retrieve
data from the clipboard no problem.
When I use this very same class in a JApplet which I run in Internet
Explorer, I cannot get the data from the Windows clipboard.
The line of code that my JApplet gets hung up on is ...
Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();
This line of code does execute properly when executed in the standalone
application.
My class does contain the line: import java.awt.datatransfer.*;
I am using the following page from the Java Developer's Almanac as a
reference.
http://javaalmanac.com/egs/java.awt.datatransfer/ToClip.html
is there a known issue with this sort of thing that I don't know about?
Hopefully I have provided enough information for you.
Thanks in advance.
Fred.
- 12
- which vs thatI am writing documentation, and I dawned on me that I don't know the
difference between "which" and "that". I have a vague intuition which
to use, but there is no logic behind it.
In fact I don't think I could define the difference between
what, which and that.
I suspect "which" has to do with picking one from a small set, where
"that" provides an algorithm for inclusion.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
- 12
- directly assigning to a field (was Java without OO)Isaac Gouy wrote:
>As-far-as-you're-concerned is OO completely defined by Smalltalk practices?
>
>If that's the case then please just write "Smalltalk OO" instead of "OO"
>
Hmm. The point of reading the references might not be to learn
Smalltalk, but to get a different perspective. After having used
Objective-C, C++, Python, and Java (not in that order) I think the
perspective of reading/using other languages is important. It
influences the programmer, and even suggests there may be better
languages to solve problems in than the ones they already use.
I don't think most Java programmers' investment in Java is so frail that
reading a Smalltalk book would shatter their world view. Perhaps it
would simply give them another perspective on their own class designs.
Same reason some people read editorals from multiple political viewpoints.
--
.tom
remove email address' dashes for replies
opensource middleware at <http://isectd.sourceforge.net>
http://gagne.homedns.org
- 15
- Eclipse debugging hanging, causing network problemsHi,
I'm new to Eclipese, and last time I used Java heavily was six years
ago, so may be new to Java as well.
I could install and run Eclipse well, but debugging gives a problem;
after a few (say, 5-10) debugging sessions, the debugger does not
start in the usual way, but gets stuck at launching stage. The status
bar shows "Launching (95%)" and takes minutes to continue from there.
The app is a local java program, very small stuff - a couple of seconds
to run, no network connections etc. If I let the IDE to get past the
launching stage it gives me a debug session, but its either stuck
without running, or extremely slow to run.
Strangely, after this happens, I get other network problems as well -
such as google toolbar (in firefox) being slow to respond etc; The only
remedy is to reboot the machine, and when rebooting, several network
related apps fail to close down and I have to terminate them. I believe
I have reasonably verified that the cause is not an independent network
issue but something associated with the debugger.
.metadata/.log file shows many errors associated with
org.eclipse.jdi.internal, including org.eclipse.jdi.TimeOutException s.
My questions:
1. is this issue known (although I couldn't see anything on the web)
and if so, how can I fix it?
2. Can I setup eclipse to use shared memory transport instead of socket
transport for debugging?
Thanks for your time,
Upali
- 16
- Database insert taking a long time and causing 500 errorHi,
My requirement is as follows:
Server: Websphere
Framework: Struts
A user will upload excel file. Excel file will have several rows. For
each row, I need to insert one row in oracle database table. And
finally success message is to be shown to the user.
I read the excel file in action class and call a oracle procedure to
insert the records to database.
The issue is that when the size of excel file is large (containing
several records), it is taking a long time to complete insertion and
it shows Internal Server 500 error on the browser. Passing small set
of records to procedure is also not helping.
I think since there is no response from the app server to the client,
this error is coming. Can anybody suggest how to solve this problem?
Thanks in advance,
Palak
- 16
- finding text in formatted JTextPane by using scannerHello I'm trying to create a program, which reads text from a text
file, by using a scanner, finds definitions for particular phrases,
depending on a rule list and stores the data in a list, by using
objects. For example, there is a rule list with the rules : is
/sentence, means /sentence, is referred to /sentence. If the user
insert the term Hypertension, then there will be a search on the
textfile by using the scanner, find the sentences that contain the
expressions from the rulelist and store them in objects ( Hypertension
is referred to blah blah blah). Each time I create an object, I store
to it the index where the sentence starts and where the sentence ends..
Now the hard part. I display the data in a jlist. They are of the form:
sentencestart, sentenceend,sentence. I need when a user clicks on an
object of this list, a JPane window to popup with the original text
(formatted) and highlight the sentence. The problem that I have is that
while I am using scanner to retrieve the words, it doesn't count the
line return character. So each time I save the place the sentence
starts and ends, it doesn't take in consideration the line return
characters. That leads the program to highlight wrong characters in the
JTextPane.
Is there any way, when I use the scanner, each time it finds a line
break or return character to take it in consideration?
Thank you... :)
|
| Author |
Message |
ittay.dror

|
Posted: 2005-7-26 23:29:00 |
Top |
java-programmer, resolving class loader
Hi,
I'm working in an environment with many class loaders. A code in some
class, creates a data for me to persist. In order to read it back, I
must find the right class loader to use. In a simple scenario, if all
the data came from one jar, I could just keep the url to that jar. But,
if the data comes from various jars (say the class loader is a war
class loader, so it has reference to 3rd party libraries), then how can
I resolve it when loading the data? Meaning, what keys do I need to
persist so that I can find the same class loader when reading the data?
Thanx,
Ittay
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Java 1.5 and system fontsHi,
I don't know if this is the right group to ask this (if not, where
should I post?), but here we go: I have two machines, both running
Debian, and installed the official Sun JDK (1.5.0_05) on both. Here's
the question: on one machine, Java applications find all fonts that
have been installed on the system; on the other, Java applications only
find a very small set of standard fonts.
Obviously, there must a difference between the two systems (they are
certainly not identical, although they are pretty similar) -- but I
can't think what it could be. It is certainly not a configuration in
the JDK itself, because the two installations on both machines are
identical (I even diff-ed both directories to be sure :-) What I don't
know is how to make fonts available to the JVM - or, what I have done
wrong/correct on either machine. I know the fonts have been installed,
because running Gimp (for instance) on either machine finds all the
fonts. The fontconfig configuration in /etc/fonts is also identifical
as far as I can see (I don't know if that has anything to do with
anything, but I checked anyway :) Also, both systems are running defoma
(the Debian font manager), but I don't know if that can help in any way
here.
Any pointers or hints would be appreciated,
Thanks,
Edsko
- 2
- Using Using EventListenerList for non gui object listeningI have a non gui object that i would like to make available for
listeners but instead of using collection/list i am using the class
javax.swing.event.EventListenerList to hold my listeners.
I understand that if it's non gui then i should not involve gui classes.
However, is this acceptable?
- 3
- Java ArchitectDoes this forum have an experienced Java Architect? I would like to
bounce a few questions to someone with some industry experience. I am
the project manager for a new software app. I would like some advice on
java architecture and technologies. Appreciate this is all high-level,
but if certain technologies jump out to you then please let me know.
Scenario: Message brokering of news items over a LAN
User view is a java applet or could be java enabled web page (some kind
of smart console running on their PC desktop)
For now the application will have 50 users all on the same internal
network.
Central Oracle/SQL Server Repository - holding messages.
All clients communicate with central database that holds messages and
configuration information.
Based on the config. found each java client will dynamically build drag
and drop lists/trees of this information.
Ability to screen capture based on a user selection and upload the
image to a DB repository
Each client will be able to post new messages to the server which will
need to alert the other clients.
An author of a message can see if messages have been read by the
consumers. If the user has not read the author can send a warning to
that particular user.
Licensing needs to be built in to restrict to 50 concurrent users.
Security login screens are required. Use central db server to
authenticate.
Scenario2: This is where it gets interesting. How would this change in
a WAN scenario? - Could this even work using zero front print java?
Also if you live in/near London then please let me know.
Andy
- 4
- load JNI from resource file?I am able to write a C native interface and load it using the
System.loadLibrary() routine.
Is there anyway to store the native interface library (say
"hello.dll") into a jar and then load the file from the jar?
- 5
- Quick questionI am not sure if this is the group i should post this question so
maybe you can point me in the right direction.
I have a computer and when I install the java runtime environment it
installs but when i try to access a page that uses java the screen
freezes and some times turnes scrambles with blue colors. I have
never seen anything like this. The OS works fine otherwise. I have
tryed to uninstall and reinstall. The web site I go to needs it and
if you don't have it installed it begins an installation for you.
Thanks for any help you can give me
Ben Dunning
- 6
- Java help websiteI am very new for Java programming, and I am looking for some Java help
website with a lot of examples and explan, anyone can help
- 7
- Screen Fonts in SwingHello everybody;
Is there a way to access screen fonts (Fixedsys, Courier, Terminal ...)
on a windows machine using java swing. I tried the following. . .
GriphicsEnvironment.getAvailableFontFamilyNames()
but it does not return screen font names. I also tried
Font fn=new Font("Courier",Font.PLAIN,10)
But it returns 'Courier New' font instead of 'Courier'.
- 8
- Web Services Performance problemI am trying to use web services in our project in websphere server, In
this we are using swing as client to connect the EJB, which is running
thru web services. we are able to connect EJB and get the response
from websphere server using web services. The below code is in EJB as
business method
public Vector getData(){
Vector v = new Vector();
for(int i=0;i<20000;i++)
v.add("String");
return v;
}
I use SOAP RPC encoding and in the client side i use SOAP.jar to
connect the web service and get the response.
but it takes around 8 seconds to get the response.
at the same time, i used below code in EJB as business method
public Vector getData(){
Vector v = new Vector();
for(int i=0;i<20000;i++)
v.add(new DataObject("String"));
return v;
}
public class DataObject{
String str = null;
public DataObject(String data){
str = data;
}
public String getData(){
return str;
}
public void setData(String data){
this.data = data;
}
}
here, i create object for my own DataObject class.
now i connect to this EJB, it takes double the amount of time to get
the response.
Please help me, Is there any other way to increase the performance of
web services?
Thanks,
Raja
- 9
- YourKit Java Profiler 2.1 Beta 2 ReleasedChanges in build 304:
- IDE integration: Eclipse is supported under Linux
- New agent parameter 'onexit' allows to automatically capture
snapshots on profiled application exit. See bundled documentation for
details.
- New agent parameter 'debugcompat' added as a workaround for JVM bug
that causes hangup of profiled application launched in remote debug
mode (happens, for example, when Debug is used in IntelliJ IDEA 4.x).
See bundled documentation for details.
- Percents as well as absolute values are shown in CPU and memory
views
- IDE integration: navigation to source code is supported for Eclipse
(if you have previous build installed, please run 'Tools | Integrate
with IDE...' again to install the new plugin)
The list of all improvements and features planned for 2.1 can be found
at
http://www.yourkit.com/preview/index.jsp
We welcome your feedback at email***@***.com
Best regards,
YourKit Team
- 10
- Converting byte array to stringHi,
I am trying to convert a byte array to a string. I am using the
possible ways
but not getting the result.
DatagramPacket dgram = new DatagramPacket(buf, buf.length);
ByteArrayInputStream byteIn = new ByteArrayInputStream (dgram.getData
(), 0, dgram.getLength ());
ObjectInputStream oin = new ObjectInputStream(byteIn);
Object obj = oin.readObject();
String recvString = obj.toString();
DataInputStream dataIn = new DataInputStream (byteIn);
String recvString = dataIn.readLine();
String recvString = new String(dgram.getData(),0,dgram.getLength());
String recvString = dataIn.readLine();
I am trying all these to convert my byte array to a string
But I am getting exception as invalid header.
Can anybody please suggest me.
Regards,
Hari.
- 11
- visit http://www.real-article.com/java/index.phpThe www.real-article.com website provides a ton of information about
java. In addition, you will find extensive information on leading java
to help you on your way to success.
Please have a look at our java articles, products, resources, and
additional information located throughout www.real-article.com.
We strive to provide only quality articles, so if there is a specific
topic related to java that you would like us to cover, please contact
us at any time.
visit http://www.real-article.com/java/index.php
- 12
- Brand Watches Fila Men's Matrice watch #FLA55302 Discount, Replica, FakeBrand Watches Fila Men's Matrice watch #FLA55302 Discount, Replica,
Fake
Browse our Fila Men's Matrice watch #FLA55302 replica watches, which
is sure the watch you are looking for at low price. There are more
high quality designer watch replicas for selection
Fila Men's Matrice watch #FLA55302 Link : http://www.watches-brand.com/Replica-Fila-8343.html
Brand : Fila ( http://www.watches-brand.com/Fila-Replica.html )
Model : Fila Men's Matrice watch #FLA55302
Description :
<p>Digital quartz movement, Sport watch, Regular timekeeping, 100 laps
memory, World time function, 8 schedules reminder, Chronograph 1/100,
Second - Alarm, Black polycarbonate case, Lime green polyurethane
selector buttons, Black polycarbonate case, Stainless steel caseback,
50 meters/165 feet water resistant</p>
Sale Price : $ 210.00
Fila Men's Matrice watch #FLA55302 Details :
<ul>
<li>Brand: Fila</li>
<li>Dial color: Black polycarbonate case, Digital dial (253 dot m</li>
</ul>
Fila Men's Matrice watch #FLA55302 is new brand replica, join
thousands of satisfied customers and buy your Fila with total
satisfaction. A watches-brand.COM 30 Day Money Back Guarantee is
included with every Fila Replica Series for secure, risk-free online
shopping. watches-brand.COM does not charge sales tax for the Fake
Fila Men's Matrice watch #FLA55302.
All of our replica watches are shipped via EMS to worldwide. Normally
it takes 3days to prepare the fake watch you ordered and 5-10days to
transmit depending on the different destination.We pay for the free
shipping cost for total quantity over 20 pcs. The EMS tracking NO.
will be sent by email when an order is shipped from our warehouse. No
more other charges from watches-brand.com such as the tax. If you have
any other questions please check our other pages or feel free to email
us by email***@***.com.
The Same Replica Fila Watches Series :
Fila Men's Metropolis watch #21204 :
http://www.watches-brand.com/Replica-Fila-8344.html
Fila Women's Metropolis watch #21206 :
http://www.watches-brand.com/Replica-Fila-8345.html
Fila Men's Polaris watch #FLA63273 :
http://www.watches-brand.com/Replica-Fila-8346.html
Fila Men's Polaris watch #FLA63298 :
http://www.watches-brand.com/Replica-Fila-8347.html
Fila Women's Posh watch #31407 :
http://www.watches-brand.com/Replica-Fila-8348.html
Fila Men's Proteon watch #21803 :
http://www.watches-brand.com/Replica-Fila-8349.html
Fila Men's Proteon watch #21813 :
http://www.watches-brand.com/Replica-Fila-8350.html
Fila Men's Synthesis watch #31304 :
http://www.watches-brand.com/Replica-Fila-8351.html
Fila Men's Synthesis watch #31308 :
http://www.watches-brand.com/Replica-Fila-8352.html
Fila Women's The Bits watch #21601 :
http://www.watches-brand.com/Replica-Fila-8353.html
Brand Watches Fila Men's Matrice watch #FLA55302 Discount, Replica,
Fake
- 13
- question about DES APIHello All,
The following is the code I wrote to do DES encryption.
public byte[] run ()throws Exception
{
// TODO Auto-generated method stub
byte[] re = null;
byte[]re1 = null;
if (key.length != 8){
throw new DesException("Invalid Key!!!");
}
KeyGenerator kg = KeyGenerator.getInstance("DES");
SecretKey sk = kg.generateKey();
SecretKeySpec desKey = new SecretKeySpec(key, "DES");
Cipher des = Cipher.getInstance("DES");
if ((comm == Cipher.DECRYPT_MODE) && (data.length != 8)){
throw new DesException("Invalid Key!!!");
}
des.init(Cipher.ENCRYPT_MODE, desKey);
int l = des.getOutputSize(8);
re = des.doFinal(data);
des.init(Cipher.DECRYPT_MODE, desKey);
l = des.getOutputSize(16);
re1 = des.doFinal(re);
return re;
}
I don't understand why I try entrypt 8 bytes data, the the length of
return value is 16 bytes, the first 8 bytes are what I want, what are
last 8 bytes? as far as I know, for des, the input block is 8 bytes,
output block is 8 bytes too. I use this return value to decrypt, I got
correct value.
If I just input first 8bytes to decrypt I got exception.
Anyone can explain this to me or recommend any detail document about
these API?
Thanks a lot.
- 14
- Eclipse IDE Javadoc TooltipsHi:
I'm using the Eclipse IDE for Java development, but am running into
some problems with the "Content\Code Assist" feature. Normally, when I
partially enter the name of a particular class of package, the IDE
automatically displays possible completions based on that string of
text. However, the IDE is also supposed to show me the associated
Javadoc for that class.
I know that this feature is enabled because it is able to show me the
associated Javadocs for any classes that I write myself and reside in
the current project.
I have set the Javadoc location for that project to the following
directory (gotten after unzipping the documentation download file):
file:/E:/Java API/docs/api/
However, it does not show any Javadocs for the other classes that are
in the Java API.
Can anyone help out?
Thanks,
- ADH
- 15
- Execute JSP within a servlet ?Hi folks,
A bug in cocoon prevents me from using it with JSP ... so I decided to
do my own implementation. I want to load up and execute a JSP file from
within a servlet, and from the generated XML doc apply an XSL style
sheet, then send back HTML to the browser. This is doable right ? since
a jsp doc somehow gets compiled and executed within a servlet anyway
... Is there an example of how this can be done ?
Also, am I going to miss out on some possible caching that happens
magically when I invoke a jsp directly from the browser ?
Many thanks,
galpi
|
|
|