| Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java? |
|
 |
Index ‹ java-programmer
|
- Previous
- 3
- mouseClicked vs. mousePressed on Apple vs. WindowsI'm writing a Swing component which must function similarly on Apple
and Windows; and am having trouble with which event to fire off of
(this is effectively a toggle button which would ideally just be
interested in mouseClicked). For a variety of other reasons, I don't
want to make my code act on the mousePressed event.
Originally, our QA person asserted that it was busted because she was
clicking (and moving the mouse > 10 pixels) and it wasn't getting
"toggled" (this was on Windows). I won the battle there by saying
"don't move it 10 pixels; that's a drag, not a click". (after
debugging and figuring out that if you moved the mouse more than
approximately that much, the mouseClicked never came in).
However, she now claims that on Apple (OSX) that the button fails to
toggle if you move the mouse even one pixel while pressing the button.
(i.e. if you are not perfectly still while clicking).
Obviously this would be a different story. I don't have immediate
access to an Apple machine, so was wondering if anybody else had seen
this behavior. When I worked on the AWT on OS/2 at IBM, it was fairly
clear that the mouse events were determined based on native operating
system events (i.e. when Windows says it is a click, we'll say it is a
click). Don't know if that's true now or not, since I haven't seen the
code since Java 1.1.8.
---
Mike Dahmus
m dah mus @ at @ io.com
- 4
- JButton layout - equal width with no absurd stretchThank you for taking the time to enlighten me. I have been searching
and trying different things but nothing seems to work for me. All I
want to do is have a column of JButtons to the left of a JScrollPane.
I want the buttons to have equal widths (the widest button at its
minimum text-fitting width, all others stretched to an equal width) and
be only as high as they need to be for their text. The scroll pane can
fill the rest of the width (and height for that matter). Something
like this:
+----------------------------------+
| |
| +--------+ +-------------------+ |
| | A | | | |
| +--------+ | | |
| | ABCDEF | | | |
| +--------+ | JScrollPane | |
| | ABCD | | | |
| +--------+ | | |
| | | |
| +-------------------+ |
| |
+----------------------------------+
I tried box layout, but then the buttons are not equal widths. Border
layout makes the buttons equal widths, but stretches them to be as high
as the scroll pane. Grid layout stretches them both vertically and
horizontally. I think I tried gridbag layout and had the same problem
as grid layout. The type of layout I want for the buttons reminds me of
how a table would layout in an HTML document. I want to avoid using
literal size values because of L&F issues on other platforms. Shrinking
the height of the scroll pane is not an option. Does anyone have any
suggestions?
- 6
- [encoding]Stupid question regarding encodingI have written a java plugin for an application that reads a file to execute
a series of actions ; when I parse my text file I check for the existence
of the following line "#HEADER" ; it works fine on my equipment ; on
Windows somebody working with the text file encoded in utf-8 told me that
there is problem as the line containing "#HEADER" is not found !
Now I am a little bit puzzled about all this :
(a) when you write java code and compile it what happens to the
string "#HEADER" because it will be used in the following test :
if (line.equals("#HEADER") {...}
where line is read from the text file with encoding as is on the machine
where the class is executed ? in other words you are comparing what to
what ?
(b) when with a Java app you read a text file can you get its encoding
format like utf-8 or ANSI or whatever to decide about some actions to be
taken ?
I think the problem could be easily solved by replacing "#HEADER"
by "_HEADER" but I have to go to the bottom of this to understand what is
going on.
Thanks
- 6
- JSpinner causes trouble to JB 2005 designer...X-No-Archive: yes
Hi.
I try to build a GUI with the JB 2005 designer (JB 2005
Enterprise-Trial/Fondation version).
Basically it works until I want to add a JSpinner component. Then this
error happens: "null processing BeanInfo class
javax.swing.JSpinnerBeanInfo"
The component is not added. So I add it manually. But the rest of the
GUI components (following the JSpinner member variable) is mixed up
then.
Is there a workaround to this? Thanks.
-ric
- 6
- Java Web Start from CDRoedy Green wrote:
> On Sun, 19 Oct 2003 04:10:19 +0100, "Mike"
> <email***@***.com> wrote or quoted :
>
>>I don't recall having to do that once JWS is installed on the client. The
>>only thing that springs to mind is setting the mime type on a web server:
>
> I got friend to do a JRE install on a Java virgin machine, and lo to
> my delight, it set up the association.
>
> I now how have a self installing Java Web Start CD. I am 99% there. I
> think the problem has to do when you use trailing / and when you
> don't.
>
> You just put it in, and up comes the familiar dialog box about "do you
> Trust this Roedy Green fellah with this certificate."
>
> The key is this little C: program that autorun.inf
> kicks off.. It is crude but simple. It depends on 26 variants of the
> JNLP file being automatically generated.
In a platform-portable language, this is unbelievable. You've prevented use
of your product on anything but Windows.
--
Paul Lutus
http://www.arachnoid.com
- 7
- Serial Port CommunicationsI have a java application that I wrote that collects data from a
serial port on a laptop from a data collection device. Program works
well.
My bosses would like certain conditions to draw more attention than
just using the laptop's monitor. They would like two lights and a horn
to be controlled as well.
Tackling the serial input device was pretty easy, but I am not sure
where to start with this request.
1) I only have one serial port on the Laptop, but they want to control
4 devices (horn, light 1, light 2, data collection device). So how
do I handle that?
2) Where would I go to buy the other devices and what device would I
have my java program talk to in order to control them?
Thanks,
Larry
- 10
- Ultimate enterprise design pattern for 3 tiered appsSo, I feel I am close here is what I have so far.
Goal: Database driven selection of controls on forms
Goal: Business rules only aware of interfaces
Goal: Presentation layer only aware of interfaces
Database Table Person: Name, BirthDate, Gender, CreateDate, CreatedBy
Value Object:
public class Person {
private String name;
private DateTime birthDate;
private int gender;
private DateTime createDate;
private int createdBy;
}
Business Layer Object:
public interface IPersonModel {
public boolean isTeenager();
public boolean isMale();
public boolean isFemale();
}
Presentation layer Multi Column List control
public interface ITableList {
public int rowCount();
public Object getItemAtRow(int row);
public Object getValueAtRowColumn(int row, int column);
}
public interface ITableItem {
public Object getValueAtColumn(int column);
}
The most complex part is storing in a database table which fields on
the value object will be presented in the multi column list control.
It needs to be user friendly and maintainable.
One time I tried having each value object with a switch statement for a
unique number for each field. So the database contents and source code
are kept in synch e.g. 266 in the database means 'Person CreateDate'
and the value object returns that when implementing ITableItem.
It worked but relies on a code generator to make it all work.
This time around I thought I could keep a script in the database so the
user would pick the first column to be person.getCreateDate(), the
second to be person.getName() etc.
Using reflection I could generate on the fly which attribute will be
displayed in which column.
Anyone think of other options?
The other thing I need to change is it seems an unecessary dependency
for the value object to implement ITableItem - there probably needs to
be another class which does it and depending on the database values
pulls the data from the value object.
The same goes for the value object implementing the business rules.
While probably not too bad if it does, perhaps mapping the values to
something that does might work better.
Apart from the value object I am trying to anything else in all the
code knowing about fields which are only used for CRUD e.g. createDate.
CreateDate may never be used for logic - in my app - ever - so why
pass it around as business objects - better to only have things
implementing interfaces where needed.
What do you think so far?
- 10
- Advanced Tooltips in JavaHi
I want to implement dynamic interactive tooltips in java so that the
user can expand / collapse them. Also, if there are hyperlinks in the
tooltip text, the user should be able to follow up this link. For the
same purpose, I need to be able to catch any events associated with
tooltips.
I tried to search a lot on how to customize the behavior of tooltips in
Java, however couldn't find any useful information. Does anyone know
about how to proceed about this? Any suggestions / pointers would be
greatly appreciated.
Thanks,
Shraddha
- 11
- newbie with compilingHi
I am new to Java world, I download java version j2sdk1.4.1_01 to my
computer, and install it
when I try to compile program from command line type javac tst.java, I got
the following error
"Exception in thread "main" java.lang.NoClassDefFoundError:
com/sun/tools/javac/Main"
however, I can use textPad to compile it, when I try to run from textPad, I
got same error:
Thanks advance
Libin
- 12
- Socket error Windows getInputStreamHello,
Java version is 1.5.0_09. I am trying to connect from a Windows
machine to another Windows machine using sockets . Getting a socket
error for the following line. and throws EOFException
Socket s = null;
ObjectInputStream sin = null;
ObjectOutputStream sout = null;
s = new Socket( host, port );
sout = new ObjectOutputStream( s.getOutputStream() );
//write data to socket
sout.writeObject( req );
sout.flush();
InputStream is = s.getInputStream() );
sin = new ObjectInputStream( is ); // This line gives error
If I step into ObjectInputStream, I see:
public ObjectInputStream(InputStream in) throws IOException {
verifySubclass();
bin = new BlockDataInputStream(in);
handles = new HandleTable(10);
vlist = new ValidationList();
enableOverride = false;
readStreamHeader(); // This line gives error
bin.setBlockDataMode(true);
}
However, the same code works when I try to connect from Linux(Red Hat
Enterprise Linux WS release 4 (Nahant Update 5)) to Windows. Turned
off Windows firewall but no luck.
On the Windows Server I am trying to connect to a server agent waiting
on port 2002 that helps me connect to Citrix running on that machine.
The agent runs as a Windows service.
What could be wrong here?
Stack Trace
java.io.EOFException
at java.io.ObjectInputStream
$PeekInputStream.readFully(ObjectInputStream.java:2228)
at java.io.ObjectInputStream
$BlockDataInputStream.readShort(ObjectInputStream.java:2694)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:
761)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:277)
...
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
869)
at org.apache.coyote.http11.Http11BaseProtocol
$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:
664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:
527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:
80)
at org.apache.tomcat.util.threads.ThreadPool
$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
- 12
- JSP web hosting companies?I have account at http://www.eatj.com/index.jsp. It is good one.
Daniel wrote:
> Does anyone know of web hosting companies supporting JSP?
- 14
- [OT] Project documentationWell, they _are_ all Java projects... but it's OT, I know. I need to get a
handle on project documentation. Can someone toss out some options for
generating documentation? What is (or could be) behind the numbered
chapter/section/subsection format of the various PDF files (specifications
and manuals) that I download?
I have so far adopted the xml and xsl transform found in many Apache and
Jakarta projects, and that has helped tremendously for HTML documentation,
but I need to be able to hand over a document and say 'this is what I'm
building'.
Thanks,
Wendy
- 14
- DOM tree questionHi all,
For code sample domEcho02.java, every element node will have an empty text
node like below. looks like there is no direct method in the treemodel impl
or in the adaptor class that I can control this. how can I get rid of it?
// sample xml node
<pnode attr1='0'>
<cnode1 att1='attr'><value>blah</value></cnode1>
</pnode>
// will be translated in tree nodes
element: pnode
text: (empty, unnecessary)
element: cnode1
text: (empty, unnecessary)
element: value
text: blah
//should be
element: pnode
element: cnode1
element: value
text: blah
TIA
-d
- 14
- FREE JAVA GUIDE- free Java, j2ee, sql and plsql tutorialsThis site lists General Java tutorials and tutorials on specific Java
programming topics. This site lists fully documented java tutorials, java
servlets, JSP pages, and related Java technologies like sql tutorials and
plsql tutorials
All this at http://www.freejavaguide.com
--
Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-setup/200604/1
- 15
- Weird Problem w/ DecimalFormatThe following code snippet:
static DecimalFormat nf=new DecimalFormat("#####.00");
System.out.println(nf.format(1000.10));
sometimes stops working properly and instead of seeing 1000.10 I see 1000,10
(note the comma). I can't for the life of me figure out what is going on...
I'm using Java 1.3.1 on a Sun workstation.
Any ideas?
Cliff
|
| Author |
Message |
asj

|
Posted: 2004-5-5 13:27:00 |
Top |
java-programmer, Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?
The old notion that Java on desktops is slow might have to go out the
window if more studies show this:
http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html
Again, this points out the fact that there will probably be a
renaissance of Java on desktops as it percolates on Linux and Macs and
Windows desktops. We use Mac OS X iMacs at work and Java apps as
MoneyDance (a personal finance software that runs on all 3 desktops,
although it looks sorta crappy in windows) are very good looking and
extremely fast.
Now, if only IBM's open source eclipse made better looking SWT apps on
Mac and Linux...
|
| |
|
| |
 |
Risotto

|
Posted: 2004-5-5 14:26:00 |
Top |
java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?
asj wrote:
> The old notion that Java on desktops is slow might have to go out the
> window if more studies show this:
>
> http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html
>
> Again, this points out the fact that there will probably be a
> renaissance of Java on desktops as it percolates on Linux and Macs and
> Windows desktops. We use Mac OS X iMacs at work and Java apps as
> MoneyDance (a personal finance software that runs on all 3 desktops,
> although it looks sorta crappy in windows) are very good looking and
> extremely fast.
>
> Now, if only IBM's open source eclipse made better looking SWT apps on
> Mac and Linux...
At the Sun Tech Days seminar here in Seattle, they had a presentation by
Apple ( and the Apple speaker appeared in other presentations).
There seemed to be a /budding/ relationship between the two.
|
| |
|
| |
 |
Kevin McMurtrie

|
Posted: 2004-5-5 15:07:00 |
Top |
java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?
In article <email***@***.com>,
email***@***.com (asj) wrote:
> The old notion that Java on desktops is slow might have to go out the
> window if more studies show this:
>
> http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html
>
> Again, this points out the fact that there will probably be a
> renaissance of Java on desktops as it percolates on Linux and Macs and
> Windows desktops. We use Mac OS X iMacs at work and Java apps as
> MoneyDance (a personal finance software that runs on all 3 desktops,
> although it looks sorta crappy in windows) are very good looking and
> extremely fast.
>
> Now, if only IBM's open source eclipse made better looking SWT apps on
> Mac and Linux...
Of course the C version of such a test will loose. Pascal would run
even faster. The key here is the format of the strings being tested and
the similarity of the contents.
As for Objective-C, Apple should dump it because it's a butt-ugly
language that nobody wants to use. Steve Jobs could apply 240KV to his
balls and still not have a strong enough Reality Distortion Field to
encourage Cocoa development. He could monkeyboy dance like Steve
Ballmer and developers will still break into cold sweats when they think
about the nightmares using Objective-C for real product development.
Eclipse will be pretty sweet once it gets a tune-up to run faster. I've
been using the stream builds and it looks totally different on each new
version. It looks like they're searching for a new GUI design.
|
| |
|
| |
 |
Peter Ammon

|
Posted: 2004-5-5 15:08:00 |
Top |
java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?
asj wrote:
> The old notion that Java on desktops is slow might have to go out the
> window if more studies show this:
>
> http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html
>
> Again, this points out the fact that there will probably be a
> renaissance of Java on desktops as it percolates on Linux and Macs and
> Windows desktops. We use Mac OS X iMacs at work and Java apps as
> MoneyDance (a personal finance software that runs on all 3 desktops,
> although it looks sorta crappy in windows) are very good looking and
> extremely fast.
>
> Now, if only IBM's open source eclipse made better looking SWT apps on
> Mac and Linux...
Java doesn't natively support many of the Objective-C idioms, which is
why Cocoa/Java has so many contortions (like the NSSelector class).
Should Cocoa go Java-only, it wouldn't be nearly as interesting.
--
Pull out a splinter to reply.
|
| |
|
| |
 |
Peter Ammon

|
Posted: 2004-5-5 15:27:00 |
Top |
java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?
Kevin McMurtrie wrote:
> In article <email***@***.com>,
> email***@***.com (asj) wrote:
>
>
>>The old notion that Java on desktops is slow might have to go out the
>>window if more studies show this:
>>
>>http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html
>>
>>Again, this points out the fact that there will probably be a
>>renaissance of Java on desktops as it percolates on Linux and Macs and
>>Windows desktops. We use Mac OS X iMacs at work and Java apps as
>>MoneyDance (a personal finance software that runs on all 3 desktops,
>>although it looks sorta crappy in windows) are very good looking and
>>extremely fast.
>>
>>Now, if only IBM's open source eclipse made better looking SWT apps on
>>Mac and Linux...
>
>
> Of course the C version of such a test will loose. Pascal would run
> even faster. The key here is the format of the strings being tested and
> the similarity of the contents.
Turn on -mdynamic-no-pic and the C version beats the Java version by ~
30%. Make those C strings const (and do the corresponding operation
with final in Java) and the C version becomes more than one hundred
times faster than the Java version.
Just goes to show that benchmarks are easy to manipulate.
>
> As for Objective-C, Apple should dump it
Dump it for what? Have you seen what Cocoa/Java is like? It's not
exactly ready to replace Objective-C.
> because it's a butt-ugly
> language that nobody wants to use. Steve Jobs could apply 240KV to his
> balls and still not have a strong enough Reality Distortion Field to
> encourage Cocoa development. He could monkeyboy dance like Steve
> Ballmer and developers will still break into cold sweats when they think
> about the nightmares using Objective-C for real product development. >
What nightmares are those?
> Eclipse will be pretty sweet once it gets a tune-up to run faster. I've
> been using the stream builds and it looks totally different on each new
> version. It looks like they're searching for a new GUI design.
A faster Eclipse on the Mac would be most welcome.
--
Pull out a splinter to reply.
|
| |
|
| |
 |
Howard Shubs

|
Posted: 2004-5-5 19:55:00 |
Top |
java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?
In article <aO%lc.7687$email***@***.com>,
Risotto <email***@***.com> wrote:
> There seemed to be a /budding/ relationship between the two.
Keep in mind that Sun is in deep trouble.
--
When did we become machines to be serviced
rather than people to be served?
I'm a customer, not a consumer.
|
| |
|
| |
 |
clvrmnky

|
Posted: 2004-5-6 0:00:00 |
Top |
java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?
On 05/05/2004 1:26 AM, asj wrote:
> The old notion that Java on desktops is slow might have to go out the
> window if more studies show this:
>
> http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html
>
Hmmm. I'm not sure that any byte-code language could keep up with a
properly compiled application. There has been a lot of discussion
around Apple's non-choice to go with a seriously untuned GCC for
compiling Obj-C.
The resulting object code is at a serious disadvantage when compared
with compilers tuned specifically for the PPC. Not all compilers are
created equal, and Apple's GCC is known to have a lot of bottle-necks in
both the object code and runtime libraries.
There is no reason why Objective-C should necessarily be slower than
similar Java code, even with late-binding.
--
cm
|
| |
|
| |
 |
Kevin McMurtrie

|
Posted: 2004-5-6 0:35:00 |
Top |
java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?
In article <aO%lc.7687$email***@***.com>,
Risotto <email***@***.com> wrote:
> asj wrote:
>
> > The old notion that Java on desktops is slow might have to go out the
> > window if more studies show this:
> >
> > http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html
> >
> > Again, this points out the fact that there will probably be a
> > renaissance of Java on desktops as it percolates on Linux and Macs and
> > Windows desktops. We use Mac OS X iMacs at work and Java apps as
> > MoneyDance (a personal finance software that runs on all 3 desktops,
> > although it looks sorta crappy in windows) are very good looking and
> > extremely fast.
> >
> > Now, if only IBM's open source eclipse made better looking SWT apps on
> > Mac and Linux...
>
> At the Sun Tech Days seminar here in Seattle, they had a presentation by
> Apple ( and the Apple speaker appeared in other presentations).
>
> There seemed to be a /budding/ relationship between the two.
Sun is trying to forge relationships with everybody. You can't run
their new Java projects without going on a scavenger hunt for a dozen
random Apache and IBM libraries. Trying to integrate all that with an
existing product is a mess.
|
| |
|
| |
 |
GreyCloud

|
Posted: 2004-5-6 1:30:00 |
Top |
java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?
Howard Shubs wrote:
> In article <aO%lc.7687$email***@***.com>,
> Risotto <email***@***.com> wrote:
>
>
>>There seemed to be a /budding/ relationship between the two.
>
>
> Keep in mind that Sun is in deep trouble.
>
What trouble?? I've not seen anything yet that indicates that they are
in trouble.
|
| |
|
| |
 |
Dr Chaos

|
Posted: 2004-5-6 2:33:00 |
Top |
java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?
On 4 May 2004 22:26:36 -0700, asj <email***@***.com> wrote:
> The old notion that Java on desktops is slow might have to go out the
> window if more studies show this:
>
> http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html
>
> Again, this points out the fact that there will probably be a
> renaissance of Java on desktops as it percolates on Linux and Macs and
> Windows desktops. We use Mac OS X iMacs at work and Java apps as
> MoneyDance (a personal finance software that runs on all 3 desktops,
> although it looks sorta crappy in windows) are very good looking and
> extremely fast.
>
> Now, if only IBM's open source eclipse made better looking SWT apps on
> Mac and Linux...
In straight integer performance without libraries, Java now is
fast, if you also ignore startup time.
Objective-C's object model is more like Smalltalk---except
that programs pop up and dynamically link and display their fancy
GUI really fast.
You pay in performance for some dynamism there, and gain some
benefits in flexibilityi.
There's no reason why some hypothetical pre-cached Java shouldn't be
fast to startup and link too.
The question is really whether the libraries and object models
in Java are better than the O-C in Cocoa.
|
| |
|
| |
 |
Dr Chaos

|
Posted: 2004-5-6 2:39:00 |
Top |
java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?
clvrmnky <email***@***.com> wrote:
> On 05/05/2004 1:26 AM, asj wrote:
>
>> The old notion that Java on desktops is slow might have to go out the
>> window if more studies show this:
>>
>> http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html
>>
> Hmmm. I'm not sure that any byte-code language could keep up with a
> properly compiled application. There has been a lot of discussion
> around Apple's non-choice to go with a seriously untuned GCC for
> compiling Obj-C.
>
> The resulting object code is at a serious disadvantage when compared
> with compilers tuned specifically for the PPC. Not all compilers are
> created equal, and Apple's GCC is known to have a lot of bottle-necks in
> both the object code and runtime libraries.
The answer is $$$. Presumably Apple could pay for, and then spend lots
of effort modifying IBM's Power PC compiler, and then license it
for $1000 a shot or whatever IBM typically does on AIX.
And at that price how many would really buy it when GCC is free?
Maybe the new GCC intermediate representation coming up (gcc 3.5-3.6?)
will permit better optimization.
> There is no reason why Objective-C should necessarily be slower
> than similar Java code, even with late-binding. -- cm
True, the question is how much natural Objective-C code is truly
similar? I bet a fair amount of interaction with libraries involve
more dynamic Smalltalk-like constructions than typically done with Java.
This is good probably and makes programming easier, but could
conceivably have some performance cost. For user-interfaces it likely
doesn't matter much.
|
| |
|
| |
 |
clvrmnky

|
Posted: 2004-5-6 3:11:00 |
Top |
java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?
On 05/05/2004 2:39 PM, Dr Chaos wrote:
> clvrmnky <email***@***.com> wrote:
>
>>On 05/05/2004 1:26 AM, asj wrote:
>>
>>
>>>The old notion that Java on desktops is slow might have to go out the
>>>window if more studies show this:
>>>
>>>http://homepage.mac.com/spullara/rants/C1464297901/E775622191/index.html
>>>
>>
>>Hmmm. I'm not sure that any byte-code language could keep up with a
>>properly compiled application. There has been a lot of discussion
>>around Apple's non-choice to go with a seriously untuned GCC for
>>compiling Obj-C.
>>
>>The resulting object code is at a serious disadvantage when compared
>>with compilers tuned specifically for the PPC. Not all compilers are
>>created equal, and Apple's GCC is known to have a lot of bottle-necks in
>> both the object code and runtime libraries.
>
> The answer is $$$. Presumably Apple could pay for, and then spend lots
> of effort modifying IBM's Power PC compiler, and then license it
> for $1000 a shot or whatever IBM typically does on AIX.
>
That, and the IBM compiler was not ready for porting at any price when
Apple was assembling the Darwin build tools. I read the whole sordid
tale on someone's website. I cheerfully accept I could be misinformed
by the web.
>> There is no reason why Objective-C should necessarily be slower
>>than similar Java code, even with late-binding. -- cm
>
> True, the question is how much natural Objective-C code is truly
> similar? I bet a fair amount of interaction with libraries involve
> more dynamic Smalltalk-like constructions than typically done with Java.
>
> This is good probably and makes programming easier, but could
> conceivably have some performance cost. For user-interfaces it likely
> doesn't matter much.
Exactly. Though, it is the user-interface that most people complain
about when they say "Java is slow". A lot of perceived slowness or
memory issues in either Java or Obj-C UIs can probably be coded away by
a decent GUI programmer. I don't have any non-trivial examples to play
with, so all of this is academic anyway.
--
cm
|
| |
|
| |
 |
asj

|
Posted: 2004-5-6 3:19:00 |
Top |
java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?
Howard Shubs <email***@***.com> wrote in message news:<email***@***.com>...
> Keep in mind that Sun is in deep trouble.
keep in mind that sun has $5 billion cash eq. in the bank, low debt,
is twice the size of apple in revenues and has a higher market
capitalization than apple.
|
| |
|
| |
 |
Kelsey Bjarnason

|
Posted: 2004-5-6 7:23:00 |
Top |
java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?
[snips]
On Wed, 05 May 2004 00:07:18 -0700, Kevin McMurtrie wrote:
> Of course the C version of such a test will loose.
On the other hand, properly-written C code helps somewhat.
The code provided runs and generates a result of about 48000 and change on
this machine. My cleaned-up code provides a result of 970000; a speedup of
about 20 times. Mine also does 10 times more loops yet finishes faster.
[test]./original
Operations: 1000000 Seconds: 20.606744 Operations/second: 48527.802354
[test]./benchmark
Operations: 1000000 Seconds: 1.021891 Operations/second: 978577.950094
Both, obviously, do the same number of "operations" - runs of the inner
loop. The original inner loop runs from 0-100; mine runs 0-1000.
So, in reality, my speedup isn't 20 times... it's *200* times. Without
doing a single special thing to tune, tweak or otherwise optimize the
code. Just a matter of writing C code properly.
I'm not a Java geek, so I can't really comment on the quality of the Java
code provided. If it's comparable to the C code, I'd suspect his Java
results were about as good as his C results... i.e. not very.
|
| |
|
| |
 |
Tim Smith

|
Posted: 2004-5-6 11:48:00 |
Top |
java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?
In article <1c8mc.36759$email***@***.com>, clvrmnky wrote:
> Hmmm. I'm not sure that any byte-code language could keep up with a
> properly compiled application. There has been a lot of discussion
Java is compiled on most systems.
--
--Tim Smith
|
| |
|
| |
 |
The Ghost In The Machine

|
Posted: 2004-5-6 12:01:00 |
Top |
java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?
In comp.lang.java.advocacy, GreyCloud
<email***@***.com>
wrote
on Wed, 05 May 2004 11:29:53 -0600
<email***@***.com>:
>
>
> Howard Shubs wrote:
>
>> In article <aO%lc.7687$email***@***.com>,
>> Risotto <email***@***.com> wrote:
>>
>>
>>>There seemed to be a /budding/ relationship between the two.
>>
>>
>> Keep in mind that Sun is in deep trouble.
>>
>
> What trouble?? I've not seen anything yet that indicates that they are
> in trouble.
>
Dunno, but last time I checked they didn't have enough cash to
last out the year given their "burn rate". Then again, maybe
things are picking up; I'd have to look. (If they are, more
power to them. Sun may have a problem in the technical side since
Java is still proprietary, but it's arguably the most widely
used middleware tech as of right now.)
--
#191, email***@***.com
It's still legal to go .sigless.
|
| |
|
| |
 |
Howard Shubs

|
Posted: 2004-5-6 19:52:00 |
Top |
java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?
In article <email***@***.com>,
GreyCloud <email***@***.com> wrote:
> What trouble?? I've not seen anything yet that indicates that they are
> in trouble.
Then you've not been paying attention. I suggest you look before you
buy more of their hardware.
--
When did we become machines to be serviced
rather than people to be served?
I'm a customer, not a consumer.
|
| |
|
| |
 |
asj

|
Posted: 2004-5-6 23:11:00 |
Top |
java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?
The Ghost In The Machine <email***@***.com> wrote in message news:<email***@***.com>...
>
> Dunno, but last time I checked they didn't have enough cash to
> last out the year given their "burn rate". Then again, maybe
> things are picking up; I'd have to look. (If they are, more
> power to them. Sun may have a problem in the technical side since
> Java is still proprietary, but it's arguably the most widely
> used middleware tech as of right now.)
i suggest to check again. they have $5 billion in cash eq (and have
had so for a while now, with no signs that their balance sheet is in
any danger of going down), low debt, and a significant part of those
"losses" are actually non-cash, but things like one-time charges.
remember, sun is a $12 BILLION dollar company, with very high profit
margins, so they could simply stop doing research for a few months and
they would magically be in the black.
|
| |
|
| |
 |
CJT

|
Posted: 2004-5-6 23:34:00 |
Top |
java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?
Howard Shubs wrote:
> In article <email***@***.com>,
> GreyCloud <email***@***.com> wrote:
>
>
>>What trouble?? I've not seen anything yet that indicates that they are
>>in trouble.
>
>
> Then you've not been paying attention. I suggest you look before you
> buy more of their hardware.
>
They've got billions in cash (more, proportionately, than Microsoft, I
believe) -- they're not going away.
--
The e-mail address in our reply-to line is reversed in an attempt to
minimize spam. Our true address is of the form email***@***.com.
|
| |
|
| |
 |
CJT

|
Posted: 2004-5-6 23:36:00 |
Top |
java-programmer >> Is Java really faster than Obj-C ? Should Apple dump Obj-C and go with Java?
asj wrote:
> The Ghost In The Machine <email***@***.com> wrote in message news:<email***@***.com>...
>
>>Dunno, but last time I checked they didn't have enough cash to
>>last out the year given their "burn rate". Then again, maybe
>>things are picking up; I'd have to look. (If they are, more
>>power to them. Sun may have a problem in the technical side since
>>Java is still proprietary, but it's arguably the most widely
>>used middleware tech as of right now.)
>
>
> i suggest to check again. they have $5 billion in cash eq (and have
> had so for a while now, with no signs that their balance sheet is in
> any danger of going down), low debt, and a significant part of those
> "losses" are actually non-cash, but things like one-time charges.
>
> remember, sun is a $12 BILLION dollar company, with very high profit
> margins, so they could simply stop doing research for a few months and
> they would magically be in the black.
I think you have to alter that to say "very high _potential_ profit
margins," since they've been losing money for quite a while now.
--
The e-mail address in our reply-to line is reversed in an attempt to
minimize spam. Our true address is of the form email***@***.com.
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- BPEL Products(Business prcess execution Language 4 webservices)Hi,
I had a few questions about BPEL products
1) Can you let me know the BPEL Servers available in the market. Do
these need to be integrated with J2EE appservers or can they run as is
if all I want to do is integrate a few Java applications and
webservices to the flow.
2) How powerful are Weblogic Integration suite and Websphere MQSeries
Integrator for integrating Webservices using BPEL. Also how easy is it
to develop this kind of flow. Collaxa has a more pure BPEL product
that seems easier for the above task.
Thanks in Advance,
Regards,
Rahul
- 2
- too long filename? ? ?Hi
If i do the following, it will throw exception because the filename
is too long. How to fix it? I am using JBuilder X, JDK 1.4.2 and
windows XP.
try{
FileOutputStream f = new
FileOutputStream("projects\\os\\2004_03_04_JBuilderX\\2004_03_04_extras\\2004_03_04_BorlandXML\\2004_03_04_doc\\2004_03_04_api-doc\\2004_03_04_com\\2004_03_04_borland\\2004_03_04_xml\\2004_03_04_service\\2004_03_04_simpledb\\2004_03_04_jxinfo\\2004_03_04_ColumnName.html");
}catch (Exception ee){
ee.printStackTrace();
}
All the sub directory is exsit!!!
thanks
from Peter (email***@***.com)
- 3
- To smooth the movements of the mouseOn 19 jul, 07:45, Miss Elaine Eos <email***@***.com>
wrote:
> In article <email***@***.com>,
>
> email***@***.com wrote:
> > In my program, when I want to rotate or translate, movements abrupt.
> > How would you smooth the movements of the mouse?
>
> Abrupt in what way? Is it jerky? Smooth but too fast? Not able to do
> small movements?
>
> --
> Please take off your pants or I won't read your e-mail.
> I will not, no matter how "good" the deal, patronise any business which sends
> unsolicited commercial e-mail or that advertises in discussion newsgroups.
? ummm...It seems that you are dangerous...jijiji
Well, well. Movements, like the rotation, are too fast.If I move a
little the mouse, the scene is moved very fast.
I Can I make it slower?
(Sorry for my writing. I'm not english, and I'm beginning with the
English...^_^ )
Thanks
- 4
- Date ArithmeticArg,
So I know I use the Calendar abstract class. And I am betting that I use
the Add method.
Could I see a example of some date arithmetic, e.g. number of days from
today since 01/01/1964.
Must I work out the differences by year, month, day individually, convert to
a common unit of time, add them, then convert to a displayable unit of time?
Struggling...
- 5
- Graphics2D to ImageIcon problemI'm trying to do something that should be very simple.
I want to create an applet (or application, doesn't matter) to display a set
of drawn objects (drawn with a Graphics2D object). I want to be able to display
these objects in a pane by choosing them from a combo box. Two panes, one
on top with the combo box, one on the botton with the graphic.
I managed to get the images to be drawn in a simple panel stacked next to
each other but I really want to be able to select them and have them drawn
one at a time when selected in the combo box.
My program currently just instantiatest my classes that do the Graphics2D
drawing (the classes extend JPanel and just have a paint method in them)
and puts them in a grid layout.
REAL QUESTION: I would like to create an ImageIcon and just update it
with a new image when the combo box selection changes.
The problem is I can't seem to find a way to convert a
BufferedImage or a Graphics2D object into an ImageIcon.
Should I be doing this in a different way?
I don't work with JAVA everyday (though I love the language) and GUI and
graphics things just frustrate me to no end. I still haven't got the right
model in my head.
Any help would be very apprciated. Thanks,
James Kimble
--------------------------------------------------------------------------
Here's the code I have at the minute:
Main calling class:
//v 1.3
import java.awt.*;
import java.awt.geom.*;
import java.awt.event.*;
import java.util.*;
import java.math.*;
import javax.swing.*;
import java.net.URL;
public class DSP1 implements ActionListener
{
final static int NUM_IMAGES = 8;
final static int START_INDEX = 3;
JLabel waveLabel = null;
JPanel mainPanel, noisePanel, sinePanel, noisesinePanel, stonPanel;
JPanel selectPanel, displayPanel, wavePanel;
JComboBox rateChoices = null;
JComboBox freqChoices = null;
JComboBox waveOption = null;
// Constructor
public DSP1()
{
// Create the main panel to contain the two sub panels.
mainPanel = new JPanel();
mainPanel.setLayout(new GridLayout(2,1,5,5));
mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
selectPanel = new JPanel();
displayPanel = new JPanel();
waveLabel = new JLabel();
waveLabel.setHorizontalAlignment(JLabel.CENTER);
waveLabel.setVerticalAlignment(JLabel.CENTER);
waveLabel.setVerticalTextPosition(JLabel.CENTER);
waveLabel.setHorizontalTextPosition(JLabel.CENTER);
waveLabel.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createLoweredBevelBorder(),
BorderFactory.createEmptyBorder(5,5,5,5)));
waveLabel.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createEmptyBorder(0,0,10,0),
waveLabel.getBorder()));
waveLabel.setText("");
String[] Wave = { "Sine", "Noise", "Sine + Noise", "Signal/Noise" };
waveOption = new JComboBox( Wave );
waveOption.setSelectedIndex ( 1 );
// Add border around the select panel.
selectPanel.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("Select Phase"),
BorderFactory.createEmptyBorder(5,5,5,5)));
// Add border around the display panel.
displayPanel.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("Display Phase"),
BorderFactory.createEmptyBorder(5,5,5,5)));
selectPanel.add(waveOption);
displayPanel.add(waveLabel);
mainPanel.add ( selectPanel );
mainPanel.add ( displayPanel );
waveOption.addActionListener(this);
}
// Implementation of ActionListener interface.
public void actionPerformed(ActionEvent event)
{
if ( "comboBoxChanged".equals(event.getActionCommand()) )
{
System.out.println ( "In action: " +
waveOption.getSelectedIndex() );
switch ( waveOption.getSelectedIndex() )
{
case 0: wavePanel = new SineWave();
displayPanel.add(wavePanel);
break;
case 1: wavePanel = new NoiseWave();
mainPanel.add(wavePanel);
break;
case 2: wavePanel = new NoiseSineWave();
mainPanel.add(wavePanel);
break;
case 3: wavePanel = new SignaltoNoise();
mainPanel.add(wavePanel);
break;
}
}
}
// main method
public static void main(String[] args)
{
// create a new instance of DSP1
DSP1 dsp_1 = new DSP1();
// Create a frame and container for the panels.
JFrame dsp1Frame = new JFrame("Lunar Phases");
// Set the look and feel.
try
{
UIManager.setLookAndFeel(
UIManager.getCrossPlatformLookAndFeelClassName());
} catch(Exception e) {}
dsp1Frame.setContentPane(dsp_1.mainPanel);
dsp1Frame.setBounds(300,300,500,500);
// Exit when the window is closed.
dsp1Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Show the converter.
//dsp1Frame.pack();
dsp1Frame.setVisible(true);
}
}
Drawing class (they're all the same format):
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.event.*;
import java.util.*;
import java.math.*;
import javax.swing.*;
import java.net.URL;
class SineWave extends JPanel
{
static int rate;
public void paint (Graphics g)
{
Graphics2D g2D; // Get a Java 2D device context
super.paint(g);
g2D = (Graphics2D)g; // Get a Java 2D device context
g2D.drawString("Sine Wave", 250, 10); // Draw some text
g2D.drawString(" 100", 15, 95 ); // Draw some text
g2D.drawString(" 0", 15, 205); // Draw some text
g2D.drawString("-100", 15, 305); // Draw some text
g2D.drawLine ( 40, 200, 460, 200 );
int old_x = 50;
int old_y = 200;
int new_x = 50;
int new_y = 200;
for ( int i=1; i <= 100; i++ )
{
old_x = new_x;
old_y = new_y;
new_x += 4;
new_y = (int)(((Math.sin((6.2830/100.0)*i))*100)+200.0);
//System.out.println ( "From: " + old_x + ", " + old_y +
// " To: " + new_x + ", " + new_y );
g2D.drawLine ( old_x, old_y, new_x, new_y );
}
}
public static void setRate ( int r )
{
rate = r;
}
}
- 6
- has anyone gotten this exception using SkinLF?I get the following exception when loading certain skins with SkinLF
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at
com.l2fprod.gui.plaf.skin.impl.gtk.GtkSeparator.getPreferredSize(GtkSeparator.java:92)
at
com.l2fprod.gui.plaf.skin.CompoundSkin$CompoundSeparator.getPreferredSize(CompoundSkin.java:961)
at
com.l2fprod.gui.plaf.skin.SkinSeparatorUI.getPreferredSize(SkinSeparatorUI.java:84)
It only happens when i try and load certain dialogs, and I'm not sure
which dialogs it happens it. I can try and come up with a small example
if no one has seen this before. (An example of a skin this occurs with
is: b0sumiErgothemepack.zip)
thanks!
- 7
- DSHOW filter graph displayed in a java object??I am getting ready to start looking at integrating a standalone DSHOW viewer
into a java2 applet that we use for control. I know that using JMF, you can
do a media player but I simply want a window that display the DSHOW output
as part of the applet running in IE under WinXP. I currently have a static
JPEG view but want to modify for motion video.
Thanks for any ideas.
Doug George
- 8
- [Struts] ActionForm not displayed"Hamvil" <email***@***.com> wrote in message
news:email***@***.com...
> Basically i would like to fill a form with the data obtained from a
> database. Here follow a small part of the code:
>
> try {
> actionForm = registerManager.loadProfile(id);
> } catch (Exception e) {}
>
> basically actionForm is the one passed by the execute mathod.
>
> The method loadProfile returns an object RegisterBean (which extends
> ActionForm) that contain the user data loaded from the database.
I don't think you're supposed to construct your own form-- there's more to
it than the data. If you look at the API, you'll see some other attributes
that your own form is probably missing.
http://struts.apache.org/api/org/apache/struts/action/ActionForm.html
There is a way to ask the framework to make you a new form bean, but in this
case you don't really need that.
Instead of trying to replace the form bean with your own, try copying all of
the matching properties into it with:
BeanUtils.copyProperties( form, objectFromDatabase );
The Struts example webapp has an example of prepopulating a form. Using
forms as Data Transport Objects is generally frowned upon as it
unnecessarily couples your data access layer to Struts.
--
Wendy
- 9
- Import Map.class wrong version errorHi There....
I'm running into these import problems....
I'm trying to import the java.util.Map and java.util.HashMap Class on a
IBM AIX server running java 1.4.2.
Could anyone please help me in identifying what is that I am doing
wrong....
I have core.jar that has these files in the Lib dir...but still I get
the error...notably it says it is Wrong version 48 expecting 45....
I have no idea of this error could b....
Appreciate your response
/u/sharadch> $CLASSPATH
ksh:
/usr/java14/jre/lib/core.jar:/adw/adwinsp1/sqllib/java/db2java.zip:/adw/adwinsp1/sqllib/java/db2jcc.jar:/adw/adwinsp1/sqllib/java/sqlj.zip:/adw/adwinsp1/sqllib/function:/adw/adwinsp1/sqllib/java/db2jcc_license_cisuz.jar:/adw/adwinsp1/sqllib/java/db2jcc_license_cu.jar:.:
not found.
/u/sharadch> $PATH
ksh:
/usr/java14/jre/bin:/opt/oracle/product/9.2.0/bin:/usr/bin:/usr/ucb:/etc:/usr/dt/bin:/usr/bin:/usr/ucb:/etc:/usr/dt/bin:/usr/bin:/usr/ucb:/etc:/usr/dt/bin:/usr/bin:/usr/ucb:/etc:/usr/dt/bin:/usr/bin:/usr/ucb:/etc:/usr/dt/bin:/opt/openlink5/bin:/opt/openlink5/samples/ODBC:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java130/jre/bin:/usr/java130/bin:/usr/local/bin:/u/sharadch/bin:/opt/sas:/usr/local/bin:/opt/ks/bin:/opt/openlink5/bin:/opt/datamart/utilities:/usr/atria/bin:/adw/adwinsp1/sqllib/bin:/adw/adwinsp1/sqllib/adm:/adw/adwinsp1/sqllib/misc:/usr/bin:/etc:/usr/sbin:/usr/ucb:/u/sharadch/bin:/usr/bin/X11:/sbin:
not found.
/u/sharadch> cat HelloWorld.java
import java.util.Map;
import java.util.HashMap;
class HelloWorld {
public static void main(String args[]) {
System.out.print("Java Works !!!! ");
}
}/u/sharadch> javac HelloWorld.java
error: Invalid class file format:
/usr/java14/jre/lib/core.jar(java/util/Map.class), wrong version: 48,
expected 45
HelloWorld.java:1: Class java.util.Map not found in import.
import java.util.Map;
^
error: Invalid class file format:
/usr/java14/jre/lib/core.jar(java/util/HashMap.class), wrong version:
48, expected 45
HelloWorld.java:2: Class java.util.HashMap not found in import.
import java.util.HashMap;
^
error: Invalid class file format:
/usr/java14/jre/lib/core.jar(java/lang/Object.class), wrong version:
48, expected 45
HelloWorld.java:4: Superclass java.lang.Object of class HelloWorld not
found.
class HelloWorld {
^
6 errors
- 10
- String ExternalizationI know, generally, hard coding strings is not the best thing in the
world to do. However, if I am not planning on changing those strings
(especially if the application has already been written - and it's
big), is there any reason to incur the overhead (time to implement,
overhead of the use of Properties, etc) to convert an application so
it uses a .properties file.
Just curious what other developer opinions are.
Thanks.
- 11
- a cuestionHello
Which is the utility of declaring a interface without methods in Java?
thanks
- 12
- grabbing text from non-edit java windowHow do I get the text (in a java program) from a java window that is not an
edit window (ie, cannot hilight the text with a mouse)? ie, is there
something similar to in functionality to Windows API GetWindowText()?
- 13
- System clock monitoringwe have a java applet game that relies on a thread that ticks at 10n
miliseconds. Our problem is that we use the system clock time to see
the interval of ticks, and if a user manipulates the clock setting,
then we get erronous tick times.
Is there a way we can avoid this, or use the hardware clock , or some
solution where the user inteferenece will not disrupt the game ?
Thanks for all your suggestions,
-Vidhi.
- 14
- Accessing the name of the CLASS/JAR file invokedHello,
I am trying to pack all my files into a JAR - this includes CLASS
files and other textual files such as help, std configs, etc.
I would like to be able to extract them from the Java app straight out
of the JAR - and for this I need to know what the name of the JAR file
invoked was (it might have been renamed for X reasons)
Is there any sure way to do this? (the alternative is to have an
external file to contain said data, but I want to know if a way to
have everything self-contained exists, first)
Thanks,
Andrew
- 15
- imcompatible type when converting a List to arrayI have an ArrayList<Guest> which I want to convert to an Array, but I'm
getting:
init:
deps-jar:
Compiling 2 source files to /home/thufir/JavaProject28/build/classes
/home/thufir/bcit-comp2611-project2/src/a00720398/view/Tabs.java:15:
incompatible types
found : java.lang.Object[]
required: a00720398.data.Guest[]
Guest some_guests[] = FileUtil.getGuests().toArray();
1 error
BUILD FAILED (total time: 6 seconds)
If I change it to:
Object some_guests[] = FileUtil.getGuests().toArray();
then it works fine, but that's rather absurd because I know that the type
is Guest so I don't see why it would have to be an array of Object.
Surely I don't have to cast to Guest?
thanks,
Thufir
|
|
|