Hello,
We need to load and display large files (rich text) using swing, about 50mb. The problem is that the performance to render the files is incredibly poor. We tried both JTextPane and JEditorPane with no luck.
Does someone have experience with this and could give me some advise ?
thanks,
...
I'm the sole developer for an academic consortium headquartered at a university in the northeast. All of my development work involves internal tools, mostly in Java, so nothing that is released to the public. Right now, I feel like my development workflow is very "hobbyist" and is nothing like you would see at an experienced software dev...
In Spring 2.0, is there a quick way to have a list of the current servlet context's mapped URLs from inside a Controller method?
I'm writing a method called getMappedUrls(), and the purpose of this method is to show what urls are mapped in the current servlet context.
This method is to be used to generate an small online doc of availab...
To be specific, I was trying this code:
package hello;
public class Hello
{
Clock clock = new Clock();
public static void main(String args[])
{
clock.sayTime();
}
}
But it gave an error like 'Cannot access non-static field in static method main'. So I changed the declaration of clock to this:
static Clock clock ...
In PHP, we (at least the good programmers) always start general variable names with a lower-case letter, but class variables/objects with an upper-case letter to distinguish them. In the same way we start general file names with a lower case letter, but files containing Classes with an upper case letter.
E.g:
<?php
$number=123;
$string...
Hi folks!
I'm currently searching for a Java networking library. What I want to do is sending XML, JSON or other serialized messages from a client to another client and/or client to server.
My first attempt was to create an POJO for each message, plus a MessageWriter for sending and a MessageReader for receiving it. Plus socket and err...
I was trying to add Ant libraries to a project in eclipse, and I used the ones that were part of eclipse's plugins folder. When I tried to associate them with Javadocs, I couldn't locate them in the plugin folder. I searched for them online, and I found this page, in which they say the docs are not provided online because they are part o...
I've just started messing around with JLine to parse character input in console mode. It seems to work well, but I'm wondering:
Is there a nonblocking way in JLine to find out if characters are available? (i.e. like kbhit() in Windows.)
I suppose I could always wrap keyboard input in its own thread which then offers the keyboard charac...
My team has a fairly rich set of formatting rules and save actions and these rules are evolving. We're looking for a mechanism to define the centrally and propagate them automatically. We don't want to reformat the code base, but we expect the formatting to improve incrementally over time. We're using Subversion for source control, thoug...
I am working on a project that is using a JTable to display, among other things, a column of dates. We needed validation for the user input for dates, so I have implemented a combination of masking for format validation and parsing for actual date validation. I have done this using a custom CellEditor for the date column.
Inside my Mask...
Specifically, with a SortedMap<Vector<String>, int> I get "dimensions expected after this (int) token." Help!
...
Is there a CRUD generator utility in Java like Scaffolding in Rails? Can be in any framework or even plain servlets. Must generate controllers + views in jsp, not just DAO code...
...
I am wondering if there are any additional optimizations I can implement to improve the speed of reflective invocations in Java. Not that the performance is prohibitive, but I get the willies when thinking about some piece of code in a library I am writing being implemented in a tight loop somewhere.
Consider a utility method to invoke ...
Hmm, sounds easy enough but after looking at the ones that come with StringTemplate, there is no way this is easy for me the average developer.
Where does one start?
From doing some more digging it seems to accomplish this one would also have to learn the ANTLR tool to create the language file? Is that correct?
Or can I just copy one t...
Is there a way to programmatically list all geo-tagged Wikipedia entries within a radius of a long/lat point? I'm thinking this is possible with the google maps API but I am interested in any method. NOTE: I do not want to display a googlemap.
...
Clicking through JMenu options is causing my JOGL GLCanvas to flicker.
The JMenu has the setDefaultLightWeightPopupEnabled set to false. I don't want to use JGLPanel because it runs slower (the application needs to run in full screen mode).
Interesting, the flicker stops if I set sun.java2d.opengl=true on the command line. However,...
I have the following code, which splits up a Vector into a string vector (to use as a key) and an integer at the end (to use as value).
payoffs.put(new Vector<String>(keyAndOutput.subList(0, keyAndOutput.size() - 1)), Integer.parseInt(keyAndOutput.lastElement()));
The TreeMap in question is constructed using a Comparator with the foll...
try {
...
} catch (SQLException sqle) {
String theError = (sqle).getSQLState();
...
}
What does surrounding sqle with parenthesis do? Anything?
Just curious.
...
I am building an application that queries a web service. The data in the database varies and changes over time. How do I build a unit test for this type of application?
The web service sends back xml or a no search results html page. I cannot really change the web service. My application basically queries the web service using HTTPU...
I'm learning Servlets programming, using Apache Tomcat 6 on a Ubuntu 8.10 machine, and I'm running with a very annoying issue -- apparently, related to caching.
This is what I'm doing: I write a servlet, put it in a nice directory structure and deploy it using the Tomcat Web Application Manager. It works as expected. Then I edit the ser...