|
Try getting the java console up on IE6. You need to enable it on the advanced options window, restart IE, and click on it on the view window. This will give you a crude java backtrace if any exceptions occur, and will tell you about any missing classes etc..
|
|
|
|
|
I had the same problem in IE6 under WinXP, the new xp runtime environment from sun fixed the problem.
|
|
|
|
|
How can I display an Applet loading status (Such as % complete) while loading large applet?
Thank you for helping me.
|
|
|
|
|
Hi,
At this moment there are 216 Java postings in this forum and over 20,000 postings in the C++ forum. Obviously, codeproject.com is used mainly by VC++ developers but as a VC++ developer that is looking around for another job I was wondering what the big deal is about Java. I’ve never paid much attention to it and I always felt that VC++ or even VB were the way to go when writing an app for most purposes in corporate and consumer environments.
Aside from “Web applications” can you really develop real desktop applications in Java?
What development environments are the most popular? (Obviously, the Visual Studio Java environment isn’t it.)
Does Java really live up to its promise of running in any environment (as long as you have a java runtime engine.)?
|
|
|
|
|
I haven't worked much with Java (only one little project), but here is my humble opinion:
Java is a sort of VB for Unix, at least when it comes to server-side apps. Language itself is pretty nice, but libraries are bad (full of "deprecated" classes and methods). Also, it is very slow comparing to C++. I did some benchmarks, and found out that C++ can be 17 times faster when dealing with big chunks of data. On the other side, for a simple BubbleSort alghoritm, Java was only 25% slower.
As for IDE, I've heard that the best one is Borland JBuilder, but even this one is far from Visual Studio. Personally, I used only UltraEdit.
I don't know any good desktop application written in Java. There are some Java IDE (Forte, etc) but they are very slow.
I vote pro drink
|
|
|
|
|
If you want to browse a larger Java discussion group, try the CodeGuru one at http://codeguru.com/cgi-bin/bbs/wt/wwwthreads.pl?action=list&Board=java.
As a C++/MFC/Windows programmer who has moved to Java, I can tell you that the two languages have different objectives, architectures and environments, and this makes comparisons arguable. However, from my POV, while C++ is more flexible and typically faster to run, it is technically more complex and challenging (which was what I liked about it). Java is simpler, more limited, easier to code, and so is generally far more productive in an appropriate context. It allows you to concentrate more attention on the overall design and architecture because the local technical complexity is reduced. The Java libraries are moving ahead rapidly, and are much better than in the early days, with far more facilities (particularly comms & networking) provided 'out of the box' than for C++, and many 'standard' specialised libraries available free from Sun.
You can write local PC applications in Java, but it comes into its own in the corporate environment where multi-tier client-server systems are developed, and especially where web services and the internet are involved. The JVM (Java Virtual Machine) that allows the same code to run on any platform makes it attractive for developers who can write and test code on an NT box and simply copy it to a production Unix/Linux/Aix/etc. server. I notice Microsoft is taking a similar approach with languages in .NET, where they all compile to a common virtual machine code.
In my experience, corporates that are not committed Microsoft shops are moving en-masse to Java for their client-server needs, because the Java 2 Enterprise architecture makes scalable, distributed, fail-safe, multi-platform, multi-user systems so much easier and quicker to write. For example, using EJB (Enterprise JavaBeans) means that an application server can manage transactions, database access, security, load-balancing, fail-over, caching, etc. on behalf of the programmer who is then free to concentrate on the business architecture and logic.
Of course, the Microsoft world is a cosy, well catered environment for those within it, and Microsoft development tools (for all the criticism) are still, in my opinion, better than the typical Java tools at the same price point. The .NET initiative looks likely to continue the quality support for Microsoft-only developers, and for them, there is little incentive to look elsewhere. However, many corporates want the flexibility of transparent multi-platform development and the other advantages of the Java enterprise architecture, and now that the JVMs are coming of age in performance terms and many do Just-In-Time native code compilation, C++ no longer has such a performance advantage. In fact I have recently heard of device drivers being developed in Java!
If your company isn't a Microsoft-only environment moving strongly into .NET development, it's worth thinking seriously about getting some Java experience.
Dave Lorde
|
|
|
|
|
>>C++ no longer has such a performance advantage
I've been working with both Java and C++/MFC over the last two years. From my experience, Java will never come close to the performance C++ will provide. Even with Suns JVM...if you want performance you develop C++ apps, if you don't need to worry about performance, don't have a GUI and you need to get you product to market quick, go with Java.
Regarding GUI's in Java, don't put your users in the spot where they have to wait a few minutes for the program to load as Java does. I've seen GUI's that are so slow the user keeps clicking on the icon and eventually there are 15 running apps running. Then see how slow your 1g htz machine can go! That can literally bring a user to tears! Bottom line....don't ever do GUI's in Java!
|
|
|
|
|
Excellent analysis Dave.
I concur with what you say, but the problem is that server side portability, which is where Java seems to be going strong these days, is not all that important when your server is a Windows box. Microsoft is counting on more and more servers running Windows 2K/XP so they can more easily sell people on .NET's advantages, which seem to be: (a) performance, (b) tools, and (b) multi-language support.
Regards,
Alvaro
|
|
|
|
|
Alvaro Mendez wrote:
.NET's advantages, which seem to be: (a) performance, (b) tools, and (b) multi-language support.
(b) and (c) definitely, but I'm not so sure about (a). Actually, I find .NET (beta-version) to be pretty much as fast (slow) as Sun's Java (and Sun's VM is not exactly the fastest one).
I vote pro drink
|
|
|
|
|
in a nutshell:
- real desktop applications aren't written in java. (or, to be more precise: for the java platform).
- popular: Jbuilder (borland), Together control center 5.5 (GUI+CASE tool) both for enterprise programming, Sun Forte (netbeans developer) is quite advanced but complicated, it's community edition is for free and very complete (<-> jbuilder comm. edition). all written in java, all real slow. Fast and free (but no debugger, high-end-hyped features): RealJ
- Programms in java run on any JVM environment .. since java is not only a programming language...
Java is a _platform_, it's a programming language, and it is a big class library.
1) It's platform uterly failed on the client / every day app side (and for a reason); I do not have not a single java killerapp software on this java platform, and due to the fact that a big it firm (sun) is pushing java, I am wondering why it did not succeed? Clients will _never_ be java, you can forget about that.
2) Language: the java syntax is so heavily influenced by C++ I must say it is just a rip-off. Even though, not only in detail, practical class design philosophy is differnent (non multi-inheritance, interfaces).
3) class library: big and complete, but its an implementation and this means it has ups and low ... Just look at the way the GUI looks. Yak. I do not care how well designed a GUI is for a *programmer* if the end product just doesn't look professional. (that's why I still use MFC, even though I do not like it's design.. did anyone hear of QT????)
C++ is a philosophy.
So what´s the big deal about java???
1) HYPE: sun is backing it up
2) TRUTH: it has a strong *SERVER* side (J2EE=java 2 enterprise edition and EJB) because even though java is slower, J2EE scales.. This is the single place where java is ruling. But that´s the enterprise edition and it's all about 3-thiered apps. that's why one should bother about java!!
I am a professional C++ coder and as A.Stepanov (STL originator) once said, " [..] I did not find any new insights - for the first time in my life programming in a new language did not bring me new insights. [..]".
I hold courses on Java programming for it students.
|
|
|
|
|
"Clients will _never_ be java, you can forget about that. "
Having implemented 3 of those, i do not think i am sure about THAT.
The first one, quite a big one, did actually expose a very advanced gui interface compared to other business applications in that area (it is a booking application for various transportation).
The reasons for using Java on the client side?, RMI: a quite easy way to do distributed component coding without all the fuzz you have to stand up to when using Corba or DCOM. Also, using AWT (and even, argh, Swing) makes it possible to throw all your energy into designing instead of dealing with billions of implementation details.
Jan
"It could have been worse, it could have been ME!"
|
|
|
|
|
Hi,
I am using Netbeans here quite extensively, and although I enjoy the elegance of java-based gui programming, I am not satisfied with the *result* - (the finished) product.
It just lacks the smoothness and clearness of a standard windows app. And customers not acquainted with the differences of swing/mfc whatsover often want a *real* windows app.
If your customers are satisfied with a java based client, so much the better - for you! You obviously save time and nerves and money using swing / etc.
Java programming never has been unelegant from a designers or programmers view.
|
|
|
|
|
I want to create a programm that would read data from a file and will put each distinct item in a hashtable,counting how often it appears.I want to count first how often single characters or numbers appear,then how often the combination of two characters appear,three characters etc.
More specifically...
How can I use hashtable to count the appearances of some items in a file.For example how often is the letter a used,letter b etc.I am using hashtable.class in java.util.* ,but what I can not do is associate each letter that I am reading with a place in the hashtable.
For example the following code creates a hashtable called numbers with the default capacity and load factor.Then one-two-three are used as the keys and 1-2-3 as the values.
Hashtable numbers = new Hashtable();
numbers.put("one", new Integer(1));
numbers.put("two", new Integer(2));
numbers.put("three", new Integer(3));
I want my hashtable to read a file one character or one number at a time and count their appearances.
The data would most probably be in the form
abc
abcd
a
abce
ecf
e
fg
or
123
12346
12
348
7
2
3456
52
364725
Thanks a lot for suggestions to my previous question as well as to future ones.
jkouris@hotmail.com
|
|
|
|
|
How can I use hashtable to count the appearances of some items in a file.
Query the hashtable for the key before you stick it in. It it doesn't exist, add the key with value 0. If it exists, get the key's value, add 1 to it, and reinsert it into the hashtable. When you're done, the values of all keys will be the # times they were added.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I meant add it with value 1, not zero.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hello,
I am fairly new to Java and I'm trying to create a
simple application.
I need it to create an editable TextArea on the
screen and then read the text which the user types in
there and display it in a Frame after manipulating the
text in some way, e.g. setting a particular font or
size of font or colour of font.
I am sure this is fairly easy.
I know how to create an editable TextArea on the
screen however I'm not sure what to so from there.
I need to somehow pause the program until the user has
entered their text and then use the getText method () on
TextArea and assign this to a string.
I then need to manipulate the string and create a Frame and
display it in the paint method using drawstring, how
do I manipulate the text to set the font type, font
size and font colour etc??
Any ideas appreciated, I may be approaching this the
wrong way!
Here is what I have so far;
Jon.
import java.awt.*;
import java.io.*;
import java.awt.event.*;
class IOExample extends Frame {
IOExample (){
addWindowListener (new MyListener());
}
public static void main (String args[]) throws IOException {
IOExample n = new IOExample();
TextArea textarea = new TextArea(100,100);
textarea.setEditable(true);
n.add(textarea);
n.show();
//need to pause here until the user has finished input. Not sure how to
//do this
String formatstring = textarea.getText();
//need to manipulate the string in some way, and I should be able to
//create new frame and display the text....
}
}
class Mylistener extends WindowAdapter{
public void WindowClosing (WindowEvent e) {
System.exit(0); } }
|
|
|
|
|
Hi Jon
Soln's Prety Simple ,
//--- your code --
public static void main (String args[]) throws IOException {
IOExample n = new IOExample();
TextArea textarea = new TextArea(100,100);
textarea.setEditable(true);
//--- Add A button HERE and add ActionListener
n.add(textarea);
n.show();
//STOP - Dont Use GetText() Here!
}
In the ActionPerformed Method of the class, Use getText().
Dont forget this..
class IOExample extends Frame implements ActionListener {
=========================
Let the TextArea, and Button be Members of the Class
IOExample and Initialize them in the Constructor.
|
|
|
|
|
The following Java class implements hashing with open addressing,using quadratic probing to resolve collisions.When I try to compile it (using microsoft's visual java),it gives me this error:Undefined name 'OpenAddressException' at line32.Could someone please tell me what is wrong with it?
[jkouris@hotmail.com]
---------------------------------------------------------------------------------------------------
public class OpenAddress
{
private int[] Element;
private int TableSize;
private int EmptyCell;
OpenAddress(int tablesize)
{
int index;
TableSize=tablesize;
EmptyCell=0;
Element=new int[tablesize];
for(index=0;index
|
|
|
|
|
change
throw new OpenAddressException("Element not found in table.");
to
throw new Exception("Element not found in table.");
|
|
|
|
|
|
I have tried setSize(), setBounds(), setMinimumSize(), setMaximumSize(), setPreferredSize(), and none of them work. The button takes up the entire applet window. Also, my applet shows up fine when I use appletviewer but when I put it in a webpage it doesn't show up. Any ideas? All input is appreciated.
|
|
|
|
|
It's been awhile since my java days -- but my first guess for you is to pick the correct layout manager.
The layout manager takes precedence over your sizing.... Is there still an XYLayout?
|
|
|
|
|
I am not familiar with layouts. Guess ill have to go reaserching =). Tnks for the reply.
|
|
|
|
|
Objects in a window are sized dynamically by the layout manager. If you don't specify a particular layout manager the default one is FlowLayout.
The layout manager asks the component for it's preffered size, then usually sets it's size to that (if it finds enough space).
If you really need to take control over an component's size they you probably need to subclass the component and override the getMinimumSize and getPreferredSize methods.
|
|
|
|
|
Anyone could suggest a book to a beginner who wants to learn Java 2 and takes the SL-275 exam?
Thanks
|
|
|
|
|