Re: Swing on Linux
Nelson Minar wrote: > > >How can I get the swing classes for jdk117v3 > > Are there any tricks to making the first Swing > windows you create come up faster, so it at least feels faster? The main thing I can suggest is to make sure you're not doing any heavy lifting before your first window _finishes_ drawing. Unfortunately, that won't necessarily be immediately after you call show(), because the painting, if nothing else, happens asynchronously. In one case, in desperation, I put a notify in my paint routine and waited on that before doing my time-intensive initialization. There are probably better hacks to be found for that. Something that helped a bit was to stop using ImageIcon for toolbar button images. Raster encoding the gifs and drawing them with straight AWT turned out to be faster and use less memory. Doing this also avoids occasional random null pointer exceptions in the JDK image loading code. Louis Tribble -- <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> Louis Tribble [EMAIL PROTECTED] Metamata, Inc. http://www.metamata.com Tools for serious Java developers. +1 510 796 0915 <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: READING HTML files from within zip or jar files
Sterling Moses wrote:
>
> Is there a quick and dirty way to read into memory (either String or
> StringBuffer) the contents of an .html file stored with a .jar or .zip.
>
> The java classes reading these files will be stored within the same .zip
> file. I need to read the .html files without really referencing the name of
> the zip or jar directly within code, for the name of the zip will change
> from distribution to distribution.
Use getResourceAsStream() to get an input stream for the HTML file,
read from that and write to a StringWriter or CharArrayWriter.
getResourceAsStream is a method of the class Class. Best bet is to use
a class that's sitting in the same directory in the zip file as the
HTML file. Then the argument to it is just "foo.html":
myObject.getClass().getResourceAsStream("foo.html")
if you have an instance, or
MyClass.class.getResourceAsStream("foo.html")
if you don't.
HTH,
Louis
--
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Louis Tribble [EMAIL PROTECTED]
Metamata, Inc. http://www.metamata.com
Tools for serious Java developers. +1 510 796 0915
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: VerifyError
Tauren Mills wrote:
>
> I'm having a problem with a VerifyError occuring when I try to run an
> application with JDK1.2pre-v2 under the JRun 2.3.1 Servlet engine. The
> application and supporting class files have not changed. Neither has the
> JRun installation. The only thing I have changed is to move from JDK1.1.7
> to 1.2pre-v2. When I do this, this exception occurs:
>
> { (Could not pre-load servlet 'se'.) java.lang.VerifyError: (class:
> twz1/jdbc/mysql/jdbcMysqlBase, method: isMultipleQuery signature:
> (Ltwz1/jdbc/mysql/jdbcMysqlConnex;)Z) Illegal use of nonvirtual function
> call
> at twz1.jdbc.mysql.jdbcMysqlDriver.(jdbcMysqlDriver.java)
>
JDK 1.1 compilers sometimes generate code that won't verify under
1.2.
If you don't have sources for the offending class to recompile with a
1.2 javac, the only solution I know of is to launch the VM with the
-noverify option.
Louis
--
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Louis Tribble [EMAIL PROTECTED]
Metamata, Inc. http://www.metamata.com
Tools for serious Java developers. +1 510 796 0915
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
--
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Louis Tribble [EMAIL PROTECTED]
Metamata, Inc. http://www.metamata.com
Tools for serious Java developers. +1 510 796 0915
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: A Java parser
Kontorotsui wrote: > > Suppose I want to do a tool that parses the java code and modifies it. > > What do you advice me to use? Are there java parsers for Linux? > If the answer is negative, what can I use? Perl (*groan*)? JavaCC is a free parser generator written in Java which generates Java code. It includes a (rigorous) Java grammar and at least one source code transformation example. It was recently moved from Sun's web site to Metamata's: http://www.metamata.com/javacc Louis Tribble -- <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> Louis Tribble [EMAIL PROTECTED] Metamata, Inc. http://www.metamata.com Tools for serious Java developers. +1 510 796 0915 <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: [Partially OT] A Java parser - part 2
Andreas Rueckert wrote:
> I've used JJTree a while ago and had some problems. It started with the simple
> fact, that the Java grammar and all derived work was copyrighted by Metamata,
> so I couldn't include it in my work. Make sure this copyright has changed, if
> you want to share your work.
JavaCC is copyrighted by Sun, although Metamata distributes and
supports it. The copyright did not and does not interfere with the
distribution of programs which include generated parsers, nor even
the distribution of modified grammar files. For example, the copyright
at the top of the example Java grammar file Java1.1.jj says:
| * Copyright (C) 1996, 1997 Sun Microsystems Inc.
| *
| * Use of this file and the system it is part of is constrained by the
| * file COPYRIGHT in the root directory of this system. You may,
| * however, make any modifications you wish to this file.
| *
| * Java files generated by running JavaCC on this file (or modified
| * versions of this file) may be used in exactly the same manner as
| * Java files generated from any grammar developed by you.
| *
| * Author: Sriram Sankar
| * Date: 3/5/97
and the COPYRIGHT file to which it refers says:
| 2. SAMPLE GRAMMARS
|
| You may modify the sample grammars included in the Software to develop
| derivatives thereof ("Sample Grammar Derivatives"), and sublicense the
| Sample Grammar Derivatives directly or indirectly to your customers.
|
| 3. DEVELOPED PRODUCTS
|
| You may use the Software to generate software program(s) ("Developed
| Programs"). Sun claims no rights in or to the Developed Programs.
Note especially the last sentence.
Louis Tribble
--
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Louis Tribble [EMAIL PROTECTED]
Metamata, Inc. http://www.metamata.com
Tools for serious Java developers. +1 510 796 0915
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
[ANN] Metamata Development Environment 2.0
Developed mostly on Linux and Blackdown VMs: Metamata is pleased to announce the release of the Metamata Development Environment, version 2.0. The Metamata Development Environment is an award winning IDE for Java with strong emphasis on debugging and incremental development. Key features include remote debugging, JSP source level debugging, remote method and statement coverage, smart browsing, interactive execution of Java statements (Java shell), fix and continue, and much more. It works with JDKs 1.3, 1.2 and 1.1, all application servers, all web browsers, Linux, Solaris, and (duck) Windows. The Personal Edition is FREE: http://www.metamata.com/download_top.html Enjoy, The Metamata Development Team -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
