Scott Palmer

Ranch Hand
+ Follow
since Jul 11, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Scott Palmer

I'm having some trouble understanding what is going on with JComponent painting.
The docs seem to indicate that if the component is opaque that the background is painted with the background colour. But I hvae found that JComponent never paints the background properly!
I have made my own component that derives from JComponent.
I override the PaintComponent method and the first line of my paintComponet calls super.paintComponent. I also called setOpaque(true) in the constructor, and just to be safe override isOpaque to always return false.
when my component is painted the "background" is painted with garbage graphics left over from the last thing that painted. I expected it to be filled with the background colour. If I do not make the compinent opaque then I do get a clean background colour of my frame showing through. So clearly JComponent is painting something for the background - but it is not working. This happens in 1.3.1 and the 1.4 beta.
I can solve my problem by deriving from JPanel instead of JComponent or by explicitly painting the background myself in the paintComponent methoid.. But I would like to understand why Jcomponent is behaving this way.
Thanks in advance for your help,
Scott
22 years ago
The only time that you get a reasonable benefit from coming to assembly language is when you have a specific algorithm that can be efficiently coded with processor specifc instructions like MMX & SSE.. otherwise it is very rarely worth it.
For that reason I doubt that it would be worthwhile doing this with java bytecode. I would be interested to hear from someone that has actually attempted this though... Are java compiler's not efficient enough? How much more performance is available if you get closer to the "virtual" metal?
22 years ago
The functionis declared with package level scope and they are in different packages.
One is com.gfarms.geometry the other is com.gfarms.console.
I think you can only implement the MyIntf interface in package com.gfarms.console the way you have it declared.
I'm not sure exactly - maybe you need to change the access level of the interface itself, or maybe it is the function specified by the interface.
22 years ago
That's normal. Most of the characters will not be defined in the font or codepage that you are using. E.g. You won't get Japanese characters if you haven't installed Japanese fonts.
There is also a file that is part of the JRE that tells the java run time what characters are available.
Look for jre/lib/font.*
22 years ago
Java WebStart launches the application in a sand box and will specifically ask you to give the application permission to write to the local file sysetm for instance.
Generally applications must be digitally signed and if the signature cannot be validated (a common occurance since most applications seem to be is self-signed jar files) You will be warned and strongly encouraged NOT to allow the program to run. If you choose to ignore this warning then the application will be launched with out the security restrictions such as those normally imposed on an applet.
I have seen problems when I ran using a pre-release JRE. In that case I got some sort of error when WebStart tried to download a JRE that matched what the application was requesting.
As far as I know the application is is launched with no arguments.
22 years ago
It could depend on the VM. For instance an optimization might be to start every object on a 32bit boundary. This alignment could improve access and on some architectures it might even be required...
22 years ago
Perhaps you would get a better response if you used a more appropriate subject!
22 years ago
Maybe you are seeing something like the minimum size of the data area in a class is the size of an int? How are you doing your tests?
22 years ago

Also the GC may think int values of one app point to memory used by a different app.


How would the GC treat this any different than getting confused about object references and int values within a single app?
Scanning the heap wil the GC have any knowledge of one app vs the other? I don't think so, but as you say it would depend on the collector.
22 years ago
The fact that the interface is implemented IS the tag.
It is just liek some sort of boolean property on the class that doesn't really take up data in the class. At least that's how I understand it.
E.g. For Serializable, if the serialization APIs can cast the Object to Serializable the they know it is ok to serialize the class. Because the APIs get a generic Object there is no data member they can check or method they can call unless EVERY class implemented that member/method. So interfaces are a usefull may of tagging.
22 years ago
Look in the Java Media Framework.. you might find some MP3 stuff there.
I know there are 100% Java MP3 players available. http://www.javazoom.net/javalayer/sources.html
This URL http://java.sun.com/pr/1999/08/pr990810-01.html indicates that a MP3 codec may be included with JMF 2.0
22 years ago
Look at the docs for Java WebStart http://java.sun.com/products/javawebstart/
That's the best bet for launching Java Applications (not applets) from a web page.
22 years ago
Nakul,
Some of your information is out of date.
As I understand it .NET allows sharing of objects written in different languages. That's why I want to know how CORBA compares to it. (point #4)
COM/DCOM implementations do exist ($$$$) for non-windows platforms. I don't know how well they actually work.
Therefore DCOM does work to some degree across networks and OS boundaries. (point #6)
COM also uses IDL - although likely Microsoft has added proprietary extensions :-) (point #8)
I agree with the concept of using a more open technology like CORBA. I also understand that Java is not the only langage inthe wolrd and some languages may be more suitable for a particular problem. So communication between objects written in different languages is an important feature.
What I am really after are the limitations and benefits of CORBA as compared to the Microsoft alternative of .NET (is .NET based on DCOM?).
Also, For a java solution what is the disadvantage/advatage of using CORBA over RMI? Given that RMI is Java only and that is good enough for a particular problem, would there be any other reason to use CORBA instead? It seems like it would just be more work in that case.
Would it make sense to focus only on CORBA and in some sense avoid RMI simply because it isn't as open (java only)? Or is there a significant advatage that RMI has when using only java may be acceptable?
Thanks to both of you for your input.
22 years ago
It should be possible to write a FAX driver using the COMM standard extension to talk to a fax modem on a serial port.
I'm not sure if there is such a driver publicly available.
I'm also not sure how many platforms the COMM extension ahas been ported to.
22 years ago
Could you explain what the problem was with newline characters?
PrintStream can be a problem in some contexts since it uses the default character encoding and for the newline character that is very likely to cause some problems. Were you expecting linefeeds, CR/LF pairs or just CR?
What did you get?
Normal ASCII is pretty much going to come out the same on most platforms that use the roman alphabet - but line termination is an exception.
22 years ago