| Java 1.5 and system fonts |
|
 |
Index ‹ java-programmer
|
- Previous
- 3
- 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
- 3
- 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
- 3
- 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.
- 4
- 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
- 4
- 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
- 4
- 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.
- 4
- 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);
- 4
- 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... :)
- 6
- resolving class loaderHi,
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
- 8
- 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??
- 11
- 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
- 14
- help me finding pathHi,
How to find the Path String from jrePath to jawtPath?
Thanks,
Sri
--
Message posted via http://www.javakb.com
- 15
- 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
- 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
- 15
- 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.
|
| Author |
Message |
Edsko de Vries

|
Posted: 2005-11-28 22:58:00 |
Top |
java-programmer, Java 1.5 and system fonts
Hi,
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
|
| |
|
| |
 |
Roedy Green

|
Posted: 2005-11-29 0:22:00 |
Top |
java-programmer >> Java 1.5 and system fonts
On 28 Nov 2005 06:58:08 -0800, "Edsko de Vries" <email***@***.com>
wrote, quoted or indirectly quoted someone who said :
>Obviously, there must a difference between the two systems (they are
>certainly not identical, although they are pretty similar)
Let me speculate. Let as say machine A is much older than machine B,
and has gradually through a series of many updates reached the same
level of OS as machine B.
Let us say that fonts on A were installed long ago, say before unicode
support was standard. They have remained undisturbed.
To test my hypothesis, check the dates and lengths of the fonts on
machine A and B. If they differ, you could try uninstalling and
reinstalling fonts on machine A.
If that did not work, if you were prepared to live dangerously, do a
full backup, then copy the B machine fonts into machine A.
If that did not work, you could reformat the disk, install your OS
from scratch, and reinstall apps and restore data.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
|
| |
|
| |
 |
Edsko de Vries

|
Posted: 2005-12-1 17:45:00 |
Top |
java-programmer >> Java 1.5 and system fonts
Hi,
Thanks for your reply. Part of your speculation is correct, part isn't.
It is correct that one machine is much older than the other, and it is
true that it does not work on the older machine, but does work on the
newer machine - however, they have both recently been fully reinstalled
(from scratch) from the exact same Debian installation disks (a version
of Sarge, just before it was upgraded to "stable"). In particular, the
fonts on both systems come from that installer. So, unfortunately, I
don't think that this is the problem.
Any other suggestions are appreciated ;)
Edsko
|
| |
|
| |
 |
Roedy Green

|
Posted: 2005-12-1 18:22:00 |
Top |
java-programmer >> Java 1.5 and system fonts
On 1 Dec 2005 01:45:12 -0800, "Edsko de Vries" <email***@***.com>
wrote, quoted or indirectly quoted someone who said :
>Thanks for your reply. Part of your speculation is correct, part isn't.
>It is correct that one machine is much older than the other, and it is
>true that it does not work on the older machine, but does work on the
>newer machine - however, they have both recently been fully reinstalled
>(from scratch) from the exact same Debian installation disks (a version
>of Sarge, just before it was upgraded to "stable"). In particular, the
>fonts on both systems come from that installer. So, unfortunately, I
>don't think that this is the problem.
If that is true, then what can be different? Pretty well only thing
that could be relevant is the video card and its drivers. Try
borrowing the video card from the new machine and installing it and
see if that fixes the problem.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
|
| |
|
| |
 |
Nigel Wade

|
Posted: 2005-12-2 21:50:00 |
Top |
java-programmer >> Java 1.5 and system fonts
Edsko de Vries wrote:
> Hi,
>
> Thanks for your reply. Part of your speculation is correct, part isn't.
> It is correct that one machine is much older than the other, and it is
> true that it does not work on the older machine, but does work on the
> newer machine - however, they have both recently been fully reinstalled
> (from scratch) from the exact same Debian installation disks (a version
> of Sarge, just before it was upgraded to "stable"). In particular, the
> fonts on both systems come from that installer. So, unfortunately, I
> don't think that this is the problem.
>
> Any other suggestions are appreciated ;)
>
> Edsko
I'm not exactly where Java gets its font definitions from. If it queries the X
font server for a list of fonts which are available there may be some
difference in the list which it returns. Try running xlsfonts on both systems
to see what they have to say.
I have a nagging recollection that Java has it's own fonts to try to make it as
similar in cross-platform configurations as possible, but I might well be
wrong.
--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : email***@***.com
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
|
| |
|
| |
 |
Thomas Weidenfeller

|
Posted: 2005-12-3 0:40:00 |
Top |
java-programmer >> Java 1.5 and system fonts
Nigel Wade wrote:
> I have a nagging recollection that Java has it's own fonts to try to make it as
> similar in cross-platform configurations as possible, but I might well be
> wrong.
Since some time Java comes with an own set of Lucida TrueType font files
in jre/lib/fonts. But
1) Not each Java VM uses these Lucida fonts as default for the Java
system fonts,. So one has to explicitly request the Lucida fonts instead
of relying on the defaults if one wants to make sure to get them on all
platforms, and
2) different VMs use different font renderers. Different font renderers
interpret these files differently. E.g. for a long time Sun's build-in
renderer in the VM ignored any hints in TrueType font files.
/Thomas
--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
|
| |
|
| |
 |
Roedy Green

|
Posted: 2005-12-3 2:33:00 |
Top |
java-programmer >> Java 1.5 and system fonts
On Fri, 02 Dec 2005 13:49:43 +0000, Nigel Wade <email***@***.com>
wrote, quoted or indirectly quoted someone who said :
>I have a nagging recollection that Java has it's own fonts to try to make it as
>similar in cross-platform configurations as possible, but I might well be
>wrong.
Java has a few fonts of its own. Look in the jre/lib/fonts
subdirectory. The fonts there sare available only to Java. They
include Sun's version of Lucida Bright, Lucida Sans and Lucida Sans
Typewriter.
For more details see http://mindprod.com/jgloss/font.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
|
| |
|
| |
 |
Edsko de Vries

|
Posted: 2005-12-15 1:58:00 |
Top |
java-programmer >> Java 1.5 and system fonts
Sorry for the delay. Yeah, that's exactly what I'm trying to find out:
where Java gets its font definitions from. I tried xlsfonts on both
machines, and they return the exact same list of fonts; so that cannot
be the problem either :-(
This is a real puzzler..
Edsko
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- 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
- 2
- 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
- 3
- comp.lang.java.{help,programmer} - what they're for (mini-FAQ 2004-10-08)Last-Modified: Fri Oct 8 11:38:42 2004 by David Alex Lamb
Archive-name: computer-lang/java/help/minifaq
Posting-Frequency: every 4 days
Before posting read Jon Skeet's "How to get answers on the comp.lang.java.*
newsgroups" at http://www.pobox.com/~skeet/java/newsgroups.html
Java FAQs and advice:
- Java FAQ (Andrew Thompson) http://www.physci.org/codes/javafaq.jsp
including his list of other FAQs http://www.physci.org/codes/javafaq.jsp#faq
- Java/Javascript/Powerbuilder HOWTO (Real Gagnon)
http://www.rgagnon.com/howto.html
- Java Glossary (Roedy Green) http://www.mindprod.com/jgloss.html
- jGuru jFAQs (John Zukowski) http://www.jguru.com/jguru/faq/
- Focus on Java (John Zukowski) http://java.about.com/
- Java Q&A (David Reilly) http://www.davidreilly.com/jcb/faq/
- Java GUI FAQ (Thomas Weidenfeller) http://www.physci.org/guifaq.jsp
comp.lang.java.help Set-up problems, catch-all first aid.
According to its charter, this unmoderated group is for immediate help
on any Java problem, especially when the source of the difficulty is
hard to pin down in terms of topics treated on other groups.
This is the appropriate group for end-users, programmers and
administrators who are having difficulty installing a system capable of
running Java applets or programs. It is also the right group for
people trying to check their understanding of something in the
language, or to troubleshoot something simple.
comp.lang.java.programmer Programming in the Java language.
An unmoderated group for discussion of Java as a programming language.
Specific example topics may include:
o types, classes, interfaces, and other language concepts
o the syntax and grammar of Java
o threaded programming in Java - sychronisation, monitors, etc.
o possible language extensions (as opposed to API extensions).
The original charter said that discussion explicitly should not include
API features that are not built into the Java language and gave examples
like networking and the AWT. These days AWT belongs in clj.gui, and
networking (and many other APIs) are often discussed in clj.programmer.
Do not post binary classfiles or long source listings on any of these
groups. Instead, the post should reference a WWW or FTP site (short source
snippets to demonstrate a particular point or problem are fine). For some
problems you might consider posting a SSCCE (Short, Self Contained, Correct
(Compilable), Example); see http://www.physci.org/codes/sscce.jsp
Don't post on topics that have their own groups, such as:
comp.lang.java.3d The Java 3D API
comp.lang.java.advocacy Arguments about X versus Y, for various Java X and Y
comp.lang.java.beans JavaBeans and similar component frameworks
comp.lang.java.corba Common Object Request Broker Architecture and Java
comp.lang.java.databases Using databases from Java
comp.lang.java.gui Java graphical user interface design and construction
comp.lang.java.machine Java virtual machines, like JVM and KVM
comp.lang.java.security Using Java securely
comp.lang.java.softwaretools Tools for developing/maintaining Java programs
Don't cross-post between these groups and c.l.j.programmer or .help -- it just
wastes the time of people reading the general groups.
Don't post about JavaScript; it's a different language. See
comp.lang.javascript instead.
--
"Yo' ideas need to be thinked befo' they are say'd" - Ian Lamb, age 3.5
http://www.cs.queensu.ca/~dalamb/ qucis->cs to reply (it's a long story...)
- 4
- 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
- 5
- Just upgraded to the newest jdk 1.5I just upgraded my jdk 1.5 to the newest version in ports after I saw a
commit fixing a performance issue.
My swing application now behaves very well without being sluggish at all
and looks much nicer than with jdk 1.4.
Thank you very much for your great work on this.
--
Christian Laursen
- 6
- 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
- 7
- Interfaces vs. Abstract.Greetings,
I have googled around a bit about this one and consulted my various Java
tomes on the differences between abstract classes and interfaces.
They seem to be similar ideas *_BUT_* interfaces have no method code (i.e.
only abstract methods), just signatures and final static identifiers.
Abstract classes can have method code as well a abstract methods, constants
and non-constants.
It is possible for a class to implement multiple interfaces (in C++ talk
inherit from multiple abstract base classes) but a class can only extend
one other class (again in C++ese inherit from one class).
Is this understanding correct?
What general guidelines do you use to determine when to use an interface vs.
abstract classes?
For example I am working on creating a ReportWriter. I want the ReportWriter
to be able to write out in PostScript, text, and in HTML. I am thinking
about using an interface.
All three need to create headers, footers, and write detail lines. However,
the details of each operation are completely different from the other.
Thanks
--
From: Mark A Framness <email***@***.com>
http: http://netnet.net/~farmer/index.html
With all of thy getting, get understanding!
Proverbs 4:7
- 8
- 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
- 9
- 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
- 10
- 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?
- 11
- 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'.
- 12
- 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.
- 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
- 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?
- 15
- Modify image and save to fileI want to read a .png image from a file, replace a color with a new color,
and write it back to a .png file.
I've managed to read the file into a BufferedImage. I've got a PixelGrabber
to look at the pixels, identify those of the old color, and replace them
with the new color, leaving me with an int[] of the pixels I want.
How do I modify write the modified pixels out to a .png file? I don't care
if I overwrite the original image or write to a new one.
No matter how I try to do it I end up with a new file that is identical to
the original, even though I can tell my code is correctly identifying the
pixels I want to change.
Please help,
Tim
|
|
|