 |
 |
Index ‹ java-programmer
|
- Previous
- 6
- java vs ircHi
Im at a crossroad as to how to implement a webchat. I have the option of
building a chat using a standard IRC server saving me the trouble of
implementing it myself, OR i can write the server myself in Java giving me
full customizability. I would tend to go with the latter approach however im
rather concerned about performance. By performance im thinking bandwidth and
server load. So my question is: is it possible to build a chat server in
Java that is
a) better or equal to an IRC server utilizing bandwidth, and
b) better or equal to an IRC servers server load?
Im thinking performance wise that IRC would be better, but im not sure
whether this is true so im asking if anyone can give me some input as to why
one solution would be better than the other.
Thanx
Mike
- 6
- static reference in a non-static methodI'm trying to run a simple program that read info from a file and
displays it on the screen. However, I am constantly getting the
following error.
==================================================================================
Exception in thread "main" java.lang.Error: Unresolved compilation
problems:
Cannot make a static reference to the non-static field tokenizer
Cannot make a static reference to the non-static field tokenizer
==================================================================================
I don't want to declare any variables static since I don't think I
need to. My code is given below.
================================================================
File myFile = new File("Info.txt");
Scanner tokenizer = new Scanner(myFile);
String str = null;
public static void main(String[] args)
{
while (tokenizer.hasNextLine())
{
System.out.println(tokenizer.next());
}
}
=========================================================================
I was getting a similar error when I was trying to read in standard
input from the user i.e. using input stream reader and buffer
reader.
Can anyone please help?
- 6
- Doctors Use This Too SSBfa5
"Ci-ialis Softabs" is better than Pfizer Viiagrra
and normal Ci-ialis because:
- Guaaraantees 36 hours lasting
- Safe to take, no side effects at all
- Boost and increase se-xual performance
- Haarder e-rectiions and quick recharge
- Proven and certified by experts and doctors
- only $3.99 per tabs
Cllick heree:
http://ossifies.com/cs/?ronn
o-ut of mai-lling lisst:
http://ossifies.com/rm.php?ronn
eD
--
To UNSUBSCRIBE, email to email***@***.com
with a subject of "unsubscribe". Trouble? Contact email***@***.com
- 7
- JGoodies JLabel with multiple linesHi
I use JGoodies Forms to create a GUI application. I need to show a simple
multiline description in the window. I use JLabel with html text like
"<HTML> ... my description ... </HTML>".
Because it's multiline, java never knows how much lines it contains and what
is initial height of that component. When I add this do panel and show on
the screen, my frame has to small height and hides some components. General
problem is that I use different fonts (almst blind user can select bigger
fonts).
code:
-------------------------------
FormLayout layout = new FormLayout("fill:500px", // kolumny
"p, 10px, p, 10px, p, 7px, p, 7px, p, 10px, p"); //
wiersze
PanelBuilder builder = new PanelBuilder(layout);
builder.setDefaultDialogBorder();
CellConstraints cc = new CellConstraints();
...........
builder.add(textArea, cc.xy(1,3));
...........
getContentPane().add(builder.getPanel());
pack();
Can anyone help me ?
Tom
- 7
- Exiting a class in the middleI am working on a multi-threaded server-socket application. I already
have lots of crazy loops which are needed in order to function
properly.
What I need to add is a function that once all the people logged-on
exited, the server would be ready to accept connections again.
IS THERE A COMMAND THAT WOULD BREAK THROUGH THE CLASS AND EXIT IT
ANYWHERE TO GO BACK TO THE CLASS, WHICH CALLED IT (IN MY CASE BACK TO
MAIN).
I tried Label:
continue Label;
but I really do have messy loops that won't let this work properly.
I also thought maybe "System.exit(1);" would work, but that terminates
the whole application.
Any suggestions would be very appreciated.
Little BrainC
- 7
- sysdeo plugin for tomcat/eclipse gone?Hello,
does anybody still have a copy of the latest pluging of sysdeo for
tomcat/eclipse integration? The link to
http://www.sysdeo.com/eclipse/tomcatPlugin.html
does not work anymore...
And I really liked this integration.
Thanks for hints.
- 7
- ports/81272: JDK 1.5 port doesn't build.Synopsis: JDK 1.5 port doesn't build.
Responsible-Changed-From-To: freebsd-amd64->freebsd-java
Responsible-Changed-By: arved
Responsible-Changed-When: Fri Nov 25 16:57:03 GMT 2005
Responsible-Changed-Why:
Refile, this looks like a ports issue.
Assign to port maintainers
http://www.freebsd.org/cgi/query-pr.cgi?pr=81272
- 7
- starting a weblogic servlet?Hello,
I have written a basic servlet of the form
public final class MyServlet extends HttpServlet
{
public void init(ServletConfig config) throws ServletException
{
super.init(config)
/* do other stuff */
}
}
My question is, what do I need to do so that the "init" method is
invoked upon servlet (i.e. Weblogic) startup? I'm using Weblogic 5.1
sp 12 on Sun Solaris.
Thanks for your help, - Dave
- 10
- pornn piictures!
contentt!
http://thecowboyfft.com
--
To UNSUBSCRIBE, email to email***@***.com
with a subject of "unsubscribe". Trouble? Contact email***@***.com
- 10
- Changing Tomcat configurationHello everyone having a slight issue with the java.home variable for
tomcat. It is pointing at the JRE instead of the JDK and I have no idea
where it is set at. If anyone knows where I can change it please inform me.
Thanks,
Jerry
- 11
- Need some assistance pleaseHello everyone! I am trying to learn java and have run into kind of a
snag. Here is the code that I have so far:
------ <begin_code> ----------
import javax.swing.*;
import javax.swing.JApplet;
import javax.swing.JOptionPane;
import java.awt.Graphics;
public class Rectangles {
public static void main ( String args[] ) {
// Variables to hold the users input
String number1;
String number2;
String number3;
String number4;
int x;
int y;
int width;
int height;
nextRect: // Continue point for drawing another Rectangle
// Gather input and parse into integers
number1 = JOptionPane.showInputDialog(null, "Please input the x value: ");
number2 = JOptionPane.showInputDialog(null, "Please input the y value: ");
number3 = JOptionPane.showInputDialog(null, "Please input the width
value: ");
number4 = JOptionPane.showInputDialog(null, "Please input the height
value: ");
x = Integer.parseInt(number1);
y = Integer.parseInt(number2);
width = Integer.parseInt(number3);
height = Integer.parseInt(number4);
public void paint( Graphics g )
{
super.paint(g);
g.drawRect(x, y, width, height);
String answer;
answer = JOptionPane.showInputDialog(null, "Would you like to draw
another rectangle? ");
if ( answer == "yes | y")
continue nextRec; // go to nextRec and start over
else
System.exit(0);
}
}
}
------ </end_code> --------
Now, the problem I am having, is I am getting an error between the 't' and
the '(' in "public void paint( Graphics g )" Please be kind in your
comments and keep in mind that I am just learning. If I am trying to do
something that I shouldn't please let me know. I would really like to
know why this won't work.
Thank you in advance!
Regards,
jlk
- 11
- instanceof strange behaviourHi there.
I have a problem that consists of the following.
In my class, I have a method named getNativePreparedStatement that
receives a parameter of the type PreparedStatement:
private PreparedStatement getNativePreparedStatement(PreparedStatement
ps)
I pass to this method a non null object of the type:
org.apache.commons.dbcp.DelegatingPreparedStatement
Inside this method, I do a conditional instruction like this:
if(ps instanceof DelegatingPreparedStatement){
//some code here
}
What happens is that in the if instruction the instanceof operator does
not recognize the object ps as a DelegatingPreparedStatement object.
Now, I am sure ps is of the type DelegatingPreparedStatement.
Does anyone have some clue why this happens?
I am running this application under the Apache Tomcat application
server and I am using struts.
Regards,
LA
- 15
- Is this a ZipInputStream Bug?
I just got thru tracking down what was happening, but I still don't know
WHY.
Im using ZipInput & Output Stream classes to make a compressed file
(actually it's an image). I create it via ZipOutputStream using a 1K
buffer for writing i.e.:
...
try { // Create the ZIP file
zos = new ZipOutputStream(new FileOutputStream(zipfname)); }
catch (IOException e) {
System.out.println("ZipOutputStream error on open.");
return null; }
try { zos.putNextEntry(new ZipEntry(imgfname)); }
catch (IOException e) {
System.out.println("ZipOutputStream error on put-entry.");
return null; }
...
try { zos.write(bbuf, 0, bix); }
catch(IOException e) {
System.out.println("ZipOutputStream error on write.");
error = true;
break;
}
...
Here bbuf is 1K.
All is ok - WinZip can extract it and the image is fine. Then I try to
read it back via ZipInputStream - i.e.:
...
try { zis = new ZipInputStream(new FileInputStream(filespec)); }
catch (IOException e) {
System.out.println("ZipInputStream error on open.");
return pixels; }
try { zent = zis.getNextEntry(); }
catch (IOException e) {
System.out.println("ZipInputStream error on get-entry.");
return pixels; }
...
while ( cnt > 0 ) {
try { rcnt = zis.read(bbuf, rcnt, cnt); }
catch(IOException ex) {
System.out.println("ex: " +ex.getMessage());
error = true; }
cnt -= rcnt;
}
...
Here is where the problem occurs. If bbuf is 128 or 256 bytes the image
returns just like it should. But if I increase it to 1K junk starts to
show up within the picture at 4K the picture is barely viewable because
of the junk and at 32K I get ArrayOutOfBounds exception during the read
(NOT related to my code). I've verified that the "junk" is data that did
not come out of the zip, the way it went in.
I'm running JDK 1.3.1 on an NT4.0 platform.
Have others seen this behavior ?
Any ideas on why ?
TIA
Don Sykes
- 15
- programming the JVMHi,
I'm wanting to program the JVM independant of a compiler by
emitting bytecodes directly and I have orderd the book by J Engel
'Programming for the JVM'.
The lead on this book from amazon is 4-6 weeks which (may?) turn
into never. Does anyone here have recommendations for alternate
texts (that are introductory/tutorial in nature, rather than
reference texts) and websites that may help me with this - so
I don't just sit kicking my heels while it possibly doesn't arrive?
I've hunted in most of the obvious places but nothing seems to
fit the need or cover the topics that the Engel book does
sensibly.
TIA
Chris
- 16
- AXIS attachment problemHi,
Currently i tried to make attachment with AXIS .
I have following error message
Exception in thread "main" AxisFault
faultCode: {http://xml.apache.org/axis/}Server.NoService
faultSubcode:
faultString: The AXIS engine could not find a target service to invoke! target
Service is null
faultActor:
faultNode:
faultDetail:
I think i could resolve my problem if i found a little attachment sample ?
Where could i found it, or a tutorial ?
Regards
Philippe
|
| Author |
Message |
tony vee

|
Posted: 2003-9-4 15:14:00 |
Top |
java-programmer, java and XML
Hi
I have the following bit of Java code:
//Use JTidy implementation to create an empty Document object
Document doc = tidy.createEmptyDocument();
//bodyElement is the body element in an HTML Document
Node first = bodyElement.getFirstChild();
Node top = doc.getDocumentElement();
top.appendChild(first);
which produces unexpected results. Basically, all I am trying to do is
retrieve the first child node contained in the body element and copy it to
the new document element. But what I get is the required element AND every
element after it - every one of the first elements siblings! I have tried so
many variations of the above, using DocumentFragments etc, but with no joy.
In order to preserve the little hair I have left, I would be grateful for
any help
Tony
|
| |
|
| |
 |
Jeroen Wenting

|
Posted: 2003-7-10 22:02:00 |
Top |
java-programmer >> java and XML
Hard to do, as most HTML is so rotten it can't be parsed without a lot of
outside interference.
You can try XSLT (look at Xalan from the Apache project), but you'll likely
be unable to get it to work well unless your HTML now is almost valid XHTML
as it is.
"Tony" <email***@***.com> wrote in message
news:kKdPa.256$email***@***.com...
> Hi
>
> Are there any open source Java tools that I can use to parse HTML into the
> more
> strict format of XHTML? Basically, I need to convert HTML into an XML
> format.
>
> Thanks
>
> Tony
>
>
|
| |
|
| |
 |
John C. Bollinger

|
Posted: 2003-7-10 22:11:00 |
Top |
java-programmer >> java and XML
Tony wrote:
> Are there any open source Java tools that I can use to parse HTML into the
> more
> strict format of XHTML? Basically, I need to convert HTML into an XML
> format.
Googling gave at least some hits that looked promising:
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=html+xhtml+translate&btnG=Google+Search
You may also wish to look at HTML Tidy, which is reputed to be able to
do the job:
http://tidy.sourceforge.net/
In general, the World Wide Web Consortium is an excellent source for all
kinds of useful information including many standards ("recommendations")
defining web formats and protocols, tools and tool references,
tutorials, and much more.
http://www.w3.org
John Bollinger
email***@***.com
|
| |
|
| |
 |
cheng_lucia

|
Posted: 2003-10-22 19:33:00 |
Top |
java-programmer >> java and XML
Hello,
I'd like store all constants in my java-Application in an XML-file.
e.g.
<constant>
<name>con</name>
<type>long</type>
<value>10</value>
</constant>
After starting the application, the java class should be able to
create a variable with the name, the type and the value.
In this example, the java class should call the line at runtime:
long con = 10;
Has anyone an idea?
Thanks
Lucia
|
| |
|
| |
 |
Johannes Koch

|
Posted: 2003-10-22 19:54:00 |
Top |
java-programmer >> java and XML
Lucia wrote:
> Hello,
>
> I'd like store all constants in my java-Application in an XML-file.
> e.g.
> <constant>
> <name>con</name>
> <type>long</type>
> <value>10</value>
> </constant>
>
> After starting the application, the java class should be able to
> create a variable with the name, the type and the value.
>
> In this example, the java class should call the line at runtime:
> long con = 10;
>
> Has anyone an idea?
Does the XMLEncoder/XMLDecoder in the java.beans package help you?
f'up2 cjlp
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
|
| |
|
| |
 |
Michael Borgwardt

|
Posted: 2003-10-22 20:13:00 |
Top |
java-programmer >> java and XML
Lucia wrote:
> I'd like store all constants in my java-Application in an XML-file.
> e.g.
> <constant>
> <name>con</name>
> <type>long</type>
> <value>10</value>
> </constant>
>
> After starting the application, the java class should be able to
> create a variable with the name, the type and the value.
>
> In this example, the java class should call the line at runtime:
> long con = 10;
>
> Has anyone an idea?
In full generality: impossible. You could set the values via the reflection
API, but you'd still have the names and types fixed in the java classes.
You could generate the classes via a custom class loader, but then you
couldn't refer to the variables except via reflection, which would be
a really dumb and unnecessarily complex way to access config data.
All in all, it's simply a very bad idea: lots and lots of complexity
for practically no gain. Why not use a .properties file?
|
| |
|
| |
 |
Steve Slatcher

|
Posted: 2003-10-22 21:24:00 |
Top |
java-programmer >> java and XML
Lucia wrote:
> Hello,
>
> I'd like store all constants in my java-Application in an XML-file.
> e.g.
> <constant>
> <name>con</name>
> <type>long</type>
> <value>10</value>
> </constant>
>
> After starting the application, the java class should be able to
> create a variable with the name, the type and the value.
>
> In this example, the java class should call the line at runtime:
> long con = 10;
>
> Has anyone an idea?
It wouldn't work exactly as you describe, but you could achieve a similar
effect with JAXB. Using JAXB you can easily convert an XML file into a
configuration object, and then you could get your "constants" from that
object.
|
| |
|
| |
 |
rhino

|
Posted: 2008-7-13 2:40:00 |
Top |
java-programmer >> java and XML
I'm getting very interested in XML, especially in using Java to create and
update XML files. However, the documents I'm reading about XML at IBM
Developer Works are, for the most part, quite dated with dates in 2002 and
earlier being typical.
How do I find out what the current practices are on XML and how to work with
it in Java? I don't want to waste a lot of time trying to figure out how to
use tools and techniques that have long since been replaced by far better
techniques. For example, having to use DOM to read an entire XML document in
order to insert a single element seems like a pretty dubious way of doing
something. It reminds me of storing data on magnetic tape and having to read
through most of the tape to add information to it. This seems more like the
1960s than the first decade of the 21st century. I have to assume that
someone has come up with better approaches by now.
I was also intrigued by Xindice but I'm not clear if this is a popular
approach or just an idea that never really amounted to anything.
Does anyone have any insights for me? Or suggestions on where to get good
information on this subject?
|
| |
|
| |
 |
Arne Vajh鴍

|
Posted: 2008-7-13 4:15:00 |
Top |
java-programmer >> java and XML
rhino wrote:
> I'm getting very interested in XML, especially in using Java to create and
> update XML files. However, the documents I'm reading about XML at IBM
> Developer Works are, for the most part, quite dated with dates in 2002 and
> earlier being typical.
The JAXP interface has not changed much since then. It is fine.
Since then StAX and JAXB has been added, but you probably want plain
JAXP.
> How do I find out what the current practices are on XML and how to work with
> it in Java? I don't want to waste a lot of time trying to figure out how to
> use tools and techniques that have long since been replaced by far better
> techniques. For example, having to use DOM to read an entire XML document in
> order to insert a single element seems like a pretty dubious way of doing
> something. It reminds me of storing data on magnetic tape and having to read
> through most of the tape to add information to it. This seems more like the
> 1960s than the first decade of the 21st century. I have to assume that
> someone has come up with better approaches by now.
Reading the entire document into memory is by far the easiest.
A W3C document and then pick data with XPath is a piece of cake. And
absolutely the modern way of doing it.
If your XML files are too big for the approach, then you can look
at SAX. SAX is as old as W3C DOM in Java - and I really think it
is a better fit for your tape analogy than W3C DOM !
Arne
|
| |
|
| |
 |
Lew

|
Posted: 2008-7-13 12:08:00 |
Top |
java-programmer >> java and XML
Arne Vajh酶j wrote:
> If your XML files are too big for the approach, then you can look
> at SAX. SAX is as old as W3C DOM in Java - and I really think it
> is a better fit for your tape analogy than W3C DOM !
SAX, and its new cousin StAX, can be blazingly fast and memory efficient for
XML processing. They support and promote a strategy of single-pass
processing, where DOM approaches tend to be memory intensive with a multi-pass
sensibility. Where the streaming parser approach applies, it can really
perform very well.
--
Lew
|
| |
|
| |
 |
QXJuZSBWYWpow7hq

|
Posted: 2008-7-13 21:35:00 |
Top |
java-programmer >> java and XML
Lew wrote:
> Arne Vajh酶j wrote:
>> If your XML files are too big for the approach, then you can look
>> at SAX. SAX is as old as W3C DOM in Java - and I really think it
>> is a better fit for your tape analogy than W3C DOM !
>
> SAX, and its new cousin StAX, can be blazingly fast and memory efficient
> for XML processing. They support and promote a strategy of single-pass
> processing, where DOM approaches tend to be memory intensive with a
> multi-pass sensibility. Where the streaming parser approach applies, it
> can really perform very well.
Yes - they perform well.
But they do have the same sequential processing characteristics
as tapes unlike DOM and XPath which is more like random access on
disk files.
Arne
|
| |
|
| |
 |
Lew

|
Posted: 2008-7-13 23:26:00 |
Top |
java-programmer >> java and XML
Arne Vajh酶j wrote:
> Lew wrote:
>> Arne Vajh酶j wrote:
>>> If your XML files are too big for the approach, then you can look
>>> at SAX. SAX is as old as W3C DOM in Java - and I really think it
>>> is a better fit for your tape analogy than W3C DOM !
>>
>> SAX, and its new cousin StAX, can be blazingly fast and memory
>> efficient for XML processing. They support and promote a strategy of
>> single-pass processing, where DOM approaches tend to be memory
>> intensive with a multi-pass sensibility. Where the streaming parser
>> approach applies, it can really perform very well.
>
> Yes - they perform well.
>
> But they do have the same sequential processing characteristics
> as tapes unlike DOM and XPath which is more like random access on
> disk files.
Indeed. This is part of the tradeoff in the decision of "[w]here the
streaming parser approach applies".
Even when one needs random access, one might still use a streaming approach to
load the InputSource. java.util.Properties is an example -
<http://java.sun.com/javase/6/docs/api/java/util/Properties.html>
it could (and likely does) use a streaming parser to implement loadFromXML(),
then it provides random access for its clients from an in-memory structure
that is not a DOM tree.
--
Lew
|
| |
|
| |
 |
QXJuZSBWYWpow7hq

|
Posted: 2008-7-13 23:50:00 |
Top |
java-programmer >> java and XML
Lew wrote:
> Even when one needs random access, one might still use a streaming
> approach to load the InputSource. java.util.Properties is an example -
> <http://java.sun.com/javase/6/docs/api/java/util/Properties.html>
> it could (and likely does) use a streaming parser to implement
> loadFromXML(), then it provides random access for its clients from an
> in-memory structure that is not a DOM tree.
A quick glance in the source code seems to indicate that it uses
W3C DOM.
And considering that properties files usually are KB not MB, then
it is should be OK.
Arne
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Highlighter and SelectionHi,
I'm trying to use highlighter. Here is my problem:
============================================================
import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.text.Highlighter;
import javax.swing.text.DefaultHighlighter.DefaultHighlightPainter;
import java.awt.Color;
public class Test {
public static void main(String[] args) {
JFrame frame = new JFrame("Text");
frame.setSize(100, 50);
JTextArea textArea = new JTextArea("This is a test");
Highlighter highlighter = textArea.getHighlighter();
textArea.setBackground(Color.lightGray);
DefaultHighlightPainter painter =
new DefaultHighlightPainter(Color.cyan);
Object o;
try {
o = highlighter.addHighlight(0, 10, painter);
} catch (Exception e) {
}
frame.getContentPane().add(textArea);
frame.setVisible(true);
}
}
=======================================
The text is highlighted ok, no problem, but when I
try to select with the mouse inside the highlighted
text, I don't see anything.
Is there a way to enforce the selection to be always
visible
Thanks
Laurent Thery
- 2
- Making an exe and using external jarsHi,
Im making an Swing application that times canoe races. I want to be
able to give my client an executable file for the application that
runs once it is double clicked. The application uses xml and for this
he has used jars from the Web Services 2.0 pack. We are developing in
Eclipse and he just uses the "add external jars" option for this. We
then use a NSIS script to create the exe.
The problem arises when we take the generated EXE and run it on
another computer.The file loads but when we try to carry out a
function that requires any of those Jars from the web services package
the application doesn't work,error messages say that you cant find the
Class specified.
Also when we create a jar for the project and try to execute that the
same problem emerges.
I have downloaded a few free exe makers via source forge and once
again the same problem emerges.
Also some redesigning needs to be done on the gui so i want to move
the app to Netbeans so if someone could tell me how to this in either
Netbeans or eclipse that would be great.
Cheers
- 3
- applet build I have the src and jars for jgui applet at www.javazoom.net under
applets. It's a winamp clone. there is an xml build file and the only thing
I know to do with this is use ant to compile these .java sources and jars to
make the .class files. This xml file is a little hard for me to read so does
anyone have any tips on compiling this with j2dk 1.5.0_06 on 98se without
using ant? I'd just like to use the compiler to compile the classes and run
the applet with j2re without having to go through the trouble of setting up
ant.
Bill
- 4
- NPE in JFileChooser on Windows XPI'm baffled. I'm just running a little test program from inside
JBuilder that invokes the JFileChooser, with a filter for only XML
files, and I'm getting this exception thrown in the console. Any ideas?
java.lang.NullPointerException
at
javax.swing.plaf.basic.BasicListUI.updateLayoutState(BasicListUI.java:1155)
at
javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI.java:1098)
at javax.swing.plaf.basic.BasicListUI.getCellBounds(BasicListUI.java:736)
at javax.swing.JList.getCellBounds(JList.java:1175)
at javax.swing.JList.ensureIndexIsVisible(JList.java:955)
at
com.sun.java.swing.plaf.windows.WindowsFileChooserUI.ensureIndexIsVisible(WindowsFileChooserUI.java:1797)
at
com.sun.java.swing.plaf.windows.WindowsFileChooserUI.ensureFileIsVisible(WindowsFileChooserUI.java:1805)
at javax.swing.JFileChooser.ensureFileIsVisible(JFileChooser.java:570)
at javax.swing.JFileChooser.setSelectedFile(JFileChooser.java:451)
at
com.sun.java.swing.plaf.windows.WindowsFileChooserUI$14.valueChanged(WindowsFileChooserUI.java:1216)
at javax.swing.JList.fireSelectionValueChanged(JList.java:1321)
at javax.swing.JList$ListSelectionHandler.valueChanged(JList.java:1335)
at
javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:187)
at
javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:167)
at
javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:214)
at
javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:402)
at
javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:411)
at
javax.swing.DefaultListSelectionModel.setSelectionInterval(DefaultListSelectionModel.java:435)
at
com.sun.java.swing.plaf.windows.WindowsFileChooserUI.setFileSelected(WindowsFileChooserUI.java:1558)
at
com.sun.java.swing.plaf.windows.WindowsFileChooserUI$DelayedSelectionUpdater.run(WindowsFileChooserUI.java:1142)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
--
Regards,
Lori Olson [TeamB]
------------
Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.
Google Advanced Newsgroup Search
http://www.google.ca/advanced_group_search
Other Newsgroup Searches:
http://www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
http://www.visi.com/~gyles19/fom-serve/cache/1.html
- 5
- Window refreshingHi everybody,
I have a problem with window refreshing.
When a button in a frame is pressed, a thread "SQLThread" is started
and computes for a long time. During this processing period I want to
see all the components in the frame (combobox, buttons, textarea)
instead of the blank grey frame!
I also added Thread.yield() in the "SQLThread" class, but without
success.
What else should I try?
Thanks in advance!
- 6
- Find your location with new GPS EN430A technologywww.enmac.com.hk
- Natural Voice Guidance
- High Resolution Touch Screen
- Bluetooth
- MP3 & Video Player
- Picture Viewer
- 2D/3D View
- Automatic Reroute
- Day/Night Mode
- Walking Mode
- Add unlimited waypoints
- Space to add your own music, pictures, and video
- Extensive POI database
- Map landforms such as rivers & parks displayed
- Support E-book function
- AC wall charger
- Built-in Li-Ion Battery
- Audio output: built-in 2W speaker and earphone jack
- Language: English, German, French, Spanish, Dutch, Hungarian,
Czechs, Danish, Norwegian, Swedish, Portuguese, Italian, Japanese,
Finnish, Romanian, Greek, Russian, Polish
- Accessories: Car Charger, Car Stand, USB Charging Cable, Manual,
Maps CD (Optional)
We do have good prices, for further information please visit our
website www.enmac.com.hk
- 7
- mvn - deploying problemHi!
I use maven to develop software and recently encounter a problem
deploying a generated project site.
I am using scp protocol (no external scp/ssh programs) for deploying
but when I invoke "mvn site:deploy"
it prompts me to accept a host's key:
> RSA key fingerprint is b4:a2:e7:8a:44:13:16:af:0a:c6:9d:c9:20:d5:32:91.
> Are you sure you want to continue connecting? (yes/no):
The problem is that although I can accept the key each time I am
deploying the project site from my local workstation, it can't be
automatically deployed by continuous integration software
(CruiseControl to be
more specific). I get this error from mvn running on the remote
machine:
> Embedded error: Cannot connect. Reason: reject HostKey: cruise.veraxsystems.pl
And my question - is there any way to force maven-site-deploy to
accept the host's key without confirmation?
The ideal solution would be adding the key to settings.xml in
<repository/> section so the deploy plugin
will not be asking for it - I wonder if this is possible.
(I have already tried to run mvn in non-interactive mode using "-b"
command line switch but this produces
the same error).
Any help appreciated.
Thanks in advance
Artur
- 8
- no vfw://0 in JMF CaptureDeviceManager getDeviceList ?Windows XP pro on an intel PIII IBM thinkpad
Java SDK 1.4.2_05-b04
JMF 2.1.1e
My usb webcam works perfectly with JMF, I used it in JMStudio however,
when I make this call
deviceListVector = CaptureDeviceManager.getDeviceList( null );
my "audio capture device" is detected however, my usb webcam at
vfw://0 is not detected. To clarify, the audio capture device and the
USB cam are entirely seperate devices.
How can I properly detect the usb webcam, and its formats, from JMF?
[ SUBLIMINAL: Please support H264 in JMF ]
- 9
- 10
- MultiTabbedPane (groups of tabs)I'd like to have groups of tabs along the right hand side of my user
interface. Each tab would use the same container where it shows the
component associated with each tab. Something like this:
My Application
Topic #1
tab A1
tab B1
tab C1
[Content Area] Topic #2
tab A2
tab B2
tab C2
Topic #3
tab A3
tab B3
tab C3
Ideally it would be nice to have 3 JTabbed Panes and add them into a
gridbaglayout and I'd set some type of attributed in jtabbedpane tieing
them all together. Any idea how this can be done?
Thanks,
Chris
--
- 11
- BigInteger exponenStumps wrote:
> Hi all, Have rattled my brain and cannot work out how to do a BigInteger a
> to the power of e, where both a and e are BigIntegers. Any help appreciated.
It occurs to me that this is probably a pretty pointless
exercise. To justify storing them as BigIntegers, both `a'
and `e' must have magnitudes of at least 2**63 (anything
smaller would fit in a `long'). So the result will be at
least (2**63)**(2**63), a number with slightly more than
1E21 bits. This leads to two problems:
- BigInteger is not "big enough" to represent such a
value. Since the bitCount() method returns an `int'
it follows that a BigInteger cannot contain more
than (2**31)-1 ~= 2E9 bits.
- Even if BigInteger could somehow accommodate such
a huge value, it wouldn't fit in your computer's
memory. 1E21 bits ~= 1E20 bytes ~= 1E11 gigabytes
~= (I had to look this up) 100 exabytes. You cannot
afford that much storage. Trust me on this.
Hence, if your problem has a feasible solution it must
also have a simpler solution. If `a' is large enough to
require a BigInteger, then `e' must be small enough to reside
in a `long' -- in fact, small enough for an `int'. On the
other hand if `e' is large, `a' must be one of {-1,0,1}.
Otherwise, the problem is not solvable with BigInteger.
So: What are you really tying to do?
--
email***@***.com
- 12
- Resizing ImageIconIf I load a jpeg into an ImageIcon, is there a way to resize the image at
runtime? I've done work in several other languages and with different
tools, but I'm new to Swing. Perhaps there's a better control, but I'm not
seeing it.
Any help appreciated.
---Michael
- 13
- RMI server endingI have noticed a problem where if I run my server locally on my PC
the server seems to run forever. This is the command I use locally:
java -Djava.rmi.server.logCalls=true
-Djava.rmi.server.disableHttp=true -cp c:\radical ecomm/eCommServer
If I restart it with the command like:
java -Djava.rmi.server.logCalls=true
-Djava.rmi.server.disableHttp=true -Djava.rmi.server.hostname=x.x.x.x
-cp c:\radical ecomm/eCommServer
It runs fine, but 5 minutes after there is no activity, the server
ends without producing any errors or any messages.
If I start it with the following command:
java -Djava.rmi.server.logCalls=true -Djava.rmi.dgc.leaseValue=9000000
-Djava.rmi.server.disableHttp=true -Djava.rmi.server.hostname=x.x.x.x
-cp c:\radical ecomm/eCommServer
It runs fine also, but 2.5 hours after the last activity from my
client, it ends the same way.
I know I am misunderstanding what I'm doing, but I need help in
determining what I need to do to make this run basically forever
unless I want to stop it.
My understanding was that it is a server process and it should run
forever. I don't understand what is different between when I run it
locally and when I run it attached to the Internet.
Can anyone shed some light on this?
Thanks!
- 14
- Newbie need details for jProgressBarhi!
I would like some details in implemeting a jProgressBar while geting
data from database. It is very complicated for me to understand all this
thread stuff (i worked in Delphi before, and there you just give the
progressBar min, max and current value and it works). If someone would be so
kind to help me.
I am working in JBuilder and am a newbie. I need an example how to use
progreesBar (or monitor) in a method inside a class, and call this method
from actionPerformed of a button!?
Thanks guys.
Zvonko
- 15
- Dice Frequency SimulationHi I'm new to JAVA Programming and need help with my homework!
The assignment: Design and implement a simple, well-documented JAVA
program that uses random numbers to simulate throwing a pair of dice
and recording the total score thrown. That is, each roll will throw
two dice, each of which can randomly result in a face up value of 1,
2, 3, 4, 5, or 6. The program should add the two values to get a
score for the roll. The score will be between 2(1+1) and 12(6+6).
The program should loop to roll the dice a total of 500 times and
should sum up how many times each score was thrown. That is, how many
of the 500 times was a total of 2 thrown, how many times was a total
of 3 thrown, etc. You will need one accumulator for each of the 11
possible scores. Afer all 500 rolls have been thrown and counted, the
program should report for each possible score (2-12), how many times
it was thrown and what % of the time it was thrown. This program
will have no input. It should produce output similar to the
following:
Total Number Percent
Rolled of Times of Time
So far, I know to use the for loop with the following values: (count =
2; count <= 500; count++) but then I'm stuck. I don't know what to do
next!!
|
|
|