Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Warblade
Apr 10, 2003

Beep Beep, Motherfucker!

standard posted:

Window -> Preferences -> Java -> Compiler -> Compiler Compliance level.

LilMike posted:

Alternatively, Warblade, check out the command line parameters for javac -source and -target, I think you'd want something like javac -source 1.3 -target 1.3... So it would only accept 1.3 compatible java and output 1.3 compatible bytecode. Bonus: you can specify these as attributes to the javac tag in your any build scripts.

Thanks guys, but it doesn't seem to work that way. In eclipse I'm already at compliance level for 1.3. And in the javac task in Ant I'm specifynig the source and target values to 1.3.

Edit: Oh, TRex already mentioned that.

TRex EaterofCars posted:

e: here -> http://java.sun.com/j2se/1.3/download.html

Thanks but it seems Sun end of life'd Windows support for 1.3. Those downloads are only for Solaris.

Adbot
ADBOT LOVES YOU

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.
Sorry, I was rushed this morning and didn't look at the link too closely :(

Those sons of bitches made it hard to find, but here it is: http://java.sun.com/products/archive/j2se/1.3.1_20/index.html

Warblade
Apr 10, 2003

Beep Beep, Motherfucker!
Thanks!

huge sesh
Jun 9, 2008

So, I've read that the policytool security system of Java is basically meaningless and that I should actually just obtain a cert from somewhere online to be able to get out of the sandbox with my applet. What's a good cert authority to buy from that will ensure I get cross-platform support?

lazypeterson
Mar 7, 2008
So I've become quite comfortable using Java and I feel I have a decent grasp on the substantial concepts (control structures, arrays, basic graphics, AWT, files I/O, etc). I've gone through my book and done several exercises in each chapter dealing with these subjects, and I'm ready to move on and learn something a little more advanced. My question is: what should I learn?

I'm thinking about looking into Swing. Is Swing very popular among Java programmers?

Any suggestions would be great. Thanks!

CT2049
Jul 24, 2007

lazypeterson posted:

I'm thinking about looking into Swing. Is Swing very popular among Java programmers?

I used to do all of my programming in Swing, I stopped using it about 2 years ago, so it may have improved since I stopped using it.

The problem I've seen with Swing is the tutorial applications you'll find online make it look like the easiest thing in the world. However, once you go beyond the simple one text box, one button, one label programs and start making anything remotely complex the the learning curve stops being a curve and turns into a brick wall. IDE's like NetBeans will try to hide a lot of the complexities but in the end they will harm you as you won't understand how to make your GUI dynamic.

ignorant slut
Apr 27, 2008
Hey everyone, I will be starting at a position in a week or two that requires EJB, but alas, I know nothing about it... can anyone recommend a decent book or online tutorial so I don't look like a complete jackass on my first day?

Warblade
Apr 10, 2003

Beep Beep, Motherfucker!
Folks, I'm pretty new to reflection. I'm running a junit test and I'm trying to get at a private field in a super-super class.

code:
Class<?> clazz = request.getClass();
clazz = clazz.getSuperclass().getSuperclass();
Field urlStringField = clazz.getDeclaredField("urlString");
urlStringField.setAccessible(true);
Object urlString = urlStringField.get(new String());
is giving me this. Cannot set String to String? WTF?

quote:

java.lang.IllegalArgumentException: Can not set java.lang.String field edu.sdsu.cs580.twitter.requests.TwitterRequest.urlString to java.lang.String
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:150)
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:37)
at sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:18)
at java.lang.reflect.Field.get(Field.java:358)
.
.
.

Warblade
Apr 10, 2003

Beep Beep, Motherfucker!

lazypeterson posted:

Any suggestions would be great. Thanks!

Are you new to programming? It kind of sounds like it from your post. Swing would take you a while and provide lots of hours of learning. Seems like a natural step.

However, part of learning a language is not just learning the syntax and the libraries, but also the conventions of the language like naming your variables and classes a certain way or understanding what is expected when you start overriding methods or implementing interfaces. For example when you override Object.equals you should also override Object.hashcode.

Also, I suggest you read Effective Java by Joshua Bloch. It has a bunch of tips on how to be a better Java programmer.

Warblade fucked around with this message at 06:51 on May 11, 2009

Contra Duck
Nov 4, 2004

#1 DAD

Warblade posted:

Folks, I'm pretty new to reflection. I'm running a junit test and I'm trying to get at a private field in a super-super class.

code:
Class<?> clazz = request.getClass();
clazz = clazz.getSuperclass().getSuperclass();
Field urlStringField = clazz.getDeclaredField("urlString");
urlStringField.setAccessible(true);
Object urlString = urlStringField.get(new String());
is giving me this. Cannot set String to String? WTF?

The Object you pass into the Field.get() method needs to be the object whose field you're after. Try this instead:

code:
Class<?> clazz = request.getClass();
clazz = clazz.getSuperclass().getSuperclass();
Field urlStringField = clazz.getDeclaredField("urlString");
urlStringField.setAccessible(true);
Object urlString = urlStringField.get(request);

Warblade
Apr 10, 2003

Beep Beep, Motherfucker!

Contra Duck posted:

The Object you pass into the Field.get() method needs to be the object whose field you're after. Try this instead:

code:
Class<?> clazz = request.getClass();
clazz = clazz.getSuperclass().getSuperclass();
Field urlStringField = clazz.getDeclaredField("urlString");
urlStringField.setAccessible(true);
Object urlString = urlStringField.get(request);

Thank you, that worked great!

Volguus
Mar 3, 2009

CT2049 posted:

I used to do all of my programming in Swing, I stopped using it about 2 years ago, so it may have improved since I stopped using it.

The problem I've seen with Swing is the tutorial applications you'll find online make it look like the easiest thing in the world. However, once you go beyond the simple one text box, one button, one label programs and start making anything remotely complex the the learning curve stops being a curve and turns into a brick wall. IDE's like NetBeans will try to hide a lot of the complexities but in the end they will harm you as you won't understand how to make your GUI dynamic.

Perhaps a book will help?
I remember applying for a job around 10 years ago (still a student), a Java programmer job. Being used with JBuilder (was version 2 or so at the time) and its designer, i never payed much attention to the GUI structure. At the job interview they gave me a very simple GUI app to do, in notepad.
I had a day. Could not make it to behave how i wanted to for the life of me.
The day after that (and not getting the job) I bought a Java Swing book (sorry, the name escapes me, there should be plenty of them now available). I learned a lot from it. What is a layout, how to use a layout properly and most importantly:
How to use GridBagLayout and how to make your own if none of them does what you need.
The MVC model is another thing I love the most in that library. I haven't found yet any other that is trying to even come close (in any other language), and its always pissing me off when I have to store the display string in the UI object and/or to store the data somewhere else.

Today, after using Java for almost 10 years now at work, I simply love Swing. I have used it in many projects. Is it worth learning over another technology? No clue. Today the Web2.0 stuff seems to be the buzz. In my view its a great way to learn Java, just by programming in Swing and looking over to the source code to see how did they do stuff.

CT2049
Jul 24, 2007

rhag posted:

Perhaps a book will help?
I remember applying for a job around 10 years ago (still a student), a Java programmer job. Being used with JBuilder (was version 2 or so at the time) and its designer, i never payed much attention to the GUI structure. At the job interview they gave me a very simple GUI app to do, in notepad.
I had a day. Could not make it to behave how i wanted to for the life of me.
The day after that (and not getting the job) I bought a Java Swing book (sorry, the name escapes me, there should be plenty of them now available). I learned a lot from it. What is a layout, how to use a layout properly and most importantly:
How to use GridBagLayout and how to make your own if none of them does what you need.
The MVC model is another thing I love the most in that library. I haven't found yet any other that is trying to even come close (in any other language), and its always pissing me off when I have to store the display string in the UI object and/or to store the data somewhere else.

Today, after using Java for almost 10 years now at work, I simply love Swing. I have used it in many projects. Is it worth learning over another technology? No clue. Today the Web2.0 stuff seems to be the buzz. In my view its a great way to learn Java, just by programming in Swing and looking over to the source code to see how did they do stuff.

If you are going to use Swing follow this man's advice. Get a book to guide you through the intricacies of Swing. I was just trying to warn about the learning curve. I've seen far to many people with failed projects because a professor, whose experience with Swing is creating a button and textbox GUI, tells them it is easy.

ynef
Jun 12, 2002
Before learning Swing, it might be good for you to learn more about multithreaded (programs that do more than one thing at a time) programming. Not only is it really cool stuff, but you have to know it to make Swing programs. No exception, you need to know threads to do GUI programming.

Volguus
Mar 3, 2009

ynef posted:

Before learning Swing, it might be good for you to learn more about multithreaded (programs that do more than one thing at a time) programming. Not only is it really cool stuff, but you have to know it to make Swing programs. No exception, you need to know threads to do GUI programming.

Well...kinda, sorta and not really.
As it is the case with everything, it depends. For very simple programs, probably you don't have to worry about it. For more complex ones, where the chances of having a long operation to execute are high, yes, it is a must.
With Java 1.6 however, it's dumb easy to do multi-threading in Swing, and to be fairly safe (SwingWorker).
As the Swing Tutorial explains there are a couple of things that you always need to be aware of:
- All the event handling operations in Swing are executed in the event dispatch thread (EDT)
- All code that deals with Swing components should be executed in this thread
- A Swing component should not be modified in a different thread than the EDT

This is why:
- The main window of a swing application should be created and displayed using SwingUtilities.invokeLater(...)
- When performing lengthy operations, use SwingWorker's doInBackground method to do your stuff, and then override done() to get the results and display them.
- You can also listen for progress change using this class, and can also make incremental updates to a Swing component with the help of this class. Everything in a thread safe manner.


For general knowledge though, yes, you do need to know what are threads, semaphores, synchronization, etc., basically whats with this concurrency crap everyone hates but has to use.

FearIt
Mar 11, 2007
Hello CoC, I was wondering how to run a desktop swing application without having the ugly console window staying in the background.

I'm currently using a batch script which simply calls "java myMainClass" and the console window seems to just get stuck there until my GUI is closed.

Is there a better way to do this?

Edit: I'm using Windows if that makes a difference.
I've also tried making a c++ executable which tries to start my java program through WinExec() but the problem still arises.

FearIt fucked around with this message at 02:53 on May 14, 2009

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
Package your program in a jar with a manifest that specifies myMainClass as the main class. Then you can just double-click on the jar to run the program.

OddObserver
Apr 3, 2009

FearIt posted:

Hello CoC, I was wondering how to run a desktop swing application without having the ugly console window staying in the background.

I'm currently using a batch script which simply calls "java myMainClass" and the console window seems to just get stuck there until my GUI is closed.

Is there a better way to do this?

Edit: I'm using Windows if that makes a difference.
I've also tried making a c++ executable which tries to start my java program through WinExec() but the problem still arises.

javaw myMainClass if my memory serves me right.

FearIt
Mar 11, 2007

OddObserver posted:

javaw myMainClass if my memory serves me right.

Jackpot, thank you OddObs

mister_gosh
May 24, 2002

I need some guidance and want to know if this is feasible.

I want to have an application which is client and server based. The client app (Swing-based) will send some information to a servlet. The servlet will place the request in a queue. The individual request may have to wait up to 20 minutes in some instances (maybe even more). The client must maintain an active connection and perhaps get updates to a field in the Swing app. Once the request is processed (this could be a quick or a long process), information is sent back to the client.

Is this feasible? What should I utilize (such as looking into a work queue type process, or use a singleton in such a way that makes this possible)?

What I had wanted to do was have the servlet dump the request into a directory. Then a scheduled task would fire every few minutes and pick up the next request from that directory. Once finished, an email would be sent to the user with the request information. This process didn't seem to be enough for the person needing this application.

Volguus
Mar 3, 2009

mister_gosh posted:

I need some guidance and want to know if this is feasible.

I want to have an application which is client and server based. The client app (Swing-based) will send some information to a servlet. The servlet will place the request in a queue. The individual request may have to wait up to 20 minutes in some instances (maybe even more). The client must maintain an active connection and perhaps get updates to a field in the Swing app. Once the request is processed (this could be a quick or a long process), information is sent back to the client.

Is this feasible? What should I utilize (such as looking into a work queue type process, or use a singleton in such a way that makes this possible)?

What I had wanted to do was have the servlet dump the request into a directory. Then a scheduled task would fire every few minutes and pick up the next request from that directory. Once finished, an email would be sent to the user with the request information. This process didn't seem to be enough for the person needing this application.

I am not sure if a servlet is the best way to go here.
You could implement your own server, with your own protocol, but probably is not worth the effort.
One idea would be to have either a RMI server or a web-service server. The client would make the request, and then it can check periodically what's the status.
Something like:
code:
//returns the ID of the task
public int queueTask(Task task);
//returns the Status (enum) of a task given its ID
public Status getTaskStatus(int id);
Then , the server part can be implemented in any way you want. Probably storing information in a database, where a thread could come and pick up new tasks every time its free. Or on a set schedule (Quartz?).

Just an idea, im sure it can be done in a billion other ways.

deedee megadoodoo
Sep 28, 2000
Two roads diverged in a wood, and I, I took the one to Flavortown, and that has made all the difference.


This is more of a Weblogic question than a straight up java question but I didn't want to start a new thread. Hopefully someone can answer.

In the Weblogic console you can set the StuckThreadMaxTime attribute to any number. Say I set it to 10 seconds and this is the code handling my requests:

code:
Thread.sleep(15000)
foo.process()
I'll get an alert in the logs warning that a thread is stuck because the thread has been sleeping for 15 seconds straight.

But what if the code is this?
code:
for (int i = 0; i < 10; i++) {
    Thread.sleep(1500); 
    foo.process()
}
It's still "sleeping" for the same total amount of time, but it's actively working on something between waits.

The reason I ask is that we have a piece of code similar to the second example and we're seeing stuck thread messages in our logs. I'm trying to determine if weblogic reports stuck threads based on the length of time it spent on an entire request or if it's looking at how much time it's spending on a specific piece of that request. In short I'm trying to determine if foo.process() is the culprit or if it's the total wait time attached to the request.


edit - Nevermind, I answered my question. For anyone who remains curious, the thread is the request. So the thread isn't getting stuck per se, just taking longer than the configured time. Weblogic doesn't know or care if the thread is stuck waiting on a lock for 15 seconds or if it's just executing a long query. Both threads look "stuck" from the server perspective.

deedee megadoodoo fucked around with this message at 21:32 on May 15, 2009

HFX
Nov 29, 2004

mister_gosh posted:

I need some guidance and want to know if this is feasible.

I want to have an application which is client and server based. The client app (Swing-based) will send some information to a servlet. The servlet will place the request in a queue. The individual request may have to wait up to 20 minutes in some instances (maybe even more). The client must maintain an active connection and perhaps get updates to a field in the Swing app. Once the request is processed (this could be a quick or a long process), information is sent back to the client.

Is this feasible? What should I utilize (such as looking into a work queue type process, or use a singleton in such a way that makes this possible)?

What I had wanted to do was have the servlet dump the request into a directory. Then a scheduled task would fire every few minutes and pick up the next request from that directory. Once finished, an email would be sent to the user with the request information. This process didn't seem to be enough for the person needing this application.

It is feasable, however, more difficult. The problem is a lot of clients will close the connection if they don't see any data flowing. The trick to this is to send out dummy characters as it waits. I had to this once as a proxy to the BIRT engine as its results would sometimes take hours to come back from the database.

You could have the servlet fire off the scheduled task too. I'd need more information if you are dead set on using servlets.

HFX fucked around with this message at 21:15 on May 15, 2009

Mill Town
Apr 17, 2006

HFX posted:

It is feasable, however, more difficult. The problem is a lot of clients will close the connection if they don't see any data flowing. The trick to this is to send out dummy characters as it waits. I had to this once as a proxy to the BIRT engine as its results would sometimes take hours to come back from the database.

You could have the servlet fire off the scheduled task too. I'd need more information if you are dead set on using servlets.

Why do you have to keep the connection open, though? Why can't you just assign a ID to each request, and when a client wants to know the status of the request, they poll the servlet, passing in the ID?

HFX
Nov 29, 2004

Mill Town posted:

Why do you have to keep the connection open, though? Why can't you just assign a ID to each request, and when a client wants to know the status of the request, they poll the servlet, passing in the ID?

You underestimate the ability of the customers to make things like that not work.

Mill Town
Apr 17, 2006

HFX posted:

You underestimate the ability of the customers to make things like that not work.

I don't trust their ability to keep a TCP connection open for more than a second, either. :v:

Rob Filter
Jan 19, 2009
As a student project I have to write minesweeper in java. There is a bit of code in the middle of my program which tries to add an array of JButtons to a JPanel with a while loop.

code:
public static class MineSweeper() {
//size = 25, ArraySize = 24, row = 5, column = 5, count = 0 at this point in time//

                JButton Mine[] = new JButton[ArraySize]; //Declares an array of JButtons

                JPanel MineGrid = new JPanel(); //Makes a JPanel, which JButtons will be attached to.
   		MineGrid.setLayout(new GridLayout (row, column)); // (I think) telling the JPanel how to add JButtons to the grid

while (count < size) { 
    		Mine = new JButton[count]; //We initialize a new JButton, which is one part of the array
    		MineGrid.add(Mine[count]); //We -try- to add the JButton to the array, but get an error which is displayed below
    		
    		count++;
   		}
}
It builds fine but when I run it I get this error as soon as the loop gets to MineGrid.add(Mine[count]):

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at Minesweeper$Minesweeperz.Minesweeper(Minesweeper.java:34)
at Minesweeper.main(Minesweeper.java:15)

I don't know why im getting this error. Anyone see anything obviously stupid?

edit: Ill edit in what each line of code is meant to do.

Rob Filter fucked around with this message at 10:07 on May 20, 2009

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
I don't understand why beginners always post code that obviously doesn't even compile. I mean, okay, you don't want to bother us with your entire program; that's commendable, and I appreciate that you've made the effort to select the parts of your program that seem important. You're even mostly right here, except that you've left out some very important contextual information, like which of these lines are declarations in the class and which are statements in a method.

Anyway. You need to learn how to read code, how to think about what it's doing, and how to execute it on paper (or in your mind). What's the meaning of the expression new JButton[blah]? How is that different from new JButton(blah)? What does it mean to say blah1 = blah2?

placid
Jul 11, 2006

Rob Filter posted:

As a student project I have to write minesweeper in java. There is a bit of code in the middle of my program which tries to add an array of JButtons to a JPanel with a while loop.

code:
public static class MineSweeper() {
//size = 25, ArraySize = 24, row = 5, column = 5, count = 0 at this point in time//

                JButton Mine[] = new JButton[ArraySize]; //Declares an array of JButtons

                JPanel MineGrid = new JPanel(); //Makes a JPanel, which JButtons will be attached to.
   		MineGrid.setLayout(new GridLayout (row, column)); // (I think) telling the JPanel how to add JButtons to the grid

while (count < size) { 
    		Mine = new JButton[count]; //We initialize a new JButton, which is one part of the array
    		MineGrid.add(Mine[count]); //We -try- to add the JButton to the array, but get an error which is displayed below
    		
    		count++;
   		}
}
It builds fine but when I run it I get this error as soon as the loop gets to MineGrid.add(Mine[count]):

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at Minesweeper$Minesweeperz.Minesweeper(Minesweeper.java:34)
at Minesweeper.main(Minesweeper.java:15)

I don't know why im getting this error. Anyone see anything obviously stupid?

edit: Ill edit in what each line of code is meant to do.

What you're actually doing on this line

code:
Mine = new JButton[count]; //We initialize a new JButton, which is one part of the array
is re-initializing the array to an array of JButton's with 0 length, hence your error on the next line when you attempt to reference the first element. To do what your comment says the line should be doing:

code:
Mine[count] = new JButton();
As an aside, it's common practice that the first letter of your variable is lower case, so as not to confuse it with a class.

Mine = mine
MineGrid = mineGrid

I also like to make variable names for any lists or collections (like your array) plural for readability's sake.

mine = mines

edit: Also you're going to get another ArrayIndexOutOfBoundsException when you try to reference Mine[24], since your array only has 24 objects. Here's an example of an easy way to iterate through an array using the array's length attribute.

code:
for (int i = 0; i < mines.length; i++)
{
    mines[i] = new JButton();
    mineGrid.add(mines[i]);
}

placid fucked around with this message at 21:54 on May 20, 2009

Rob Filter
Jan 19, 2009

placid posted:

Really clear advice

Thank you, that makes perfect sense. I shall be fixing my code.

Sylink
Apr 17, 2004

I'm looking at uploading folders/multiple pictures through a java applet and I've never used java before.

I want something roughly similar to what facebook has for its albums. Is there a barebones free example of this anywhere I can bend to my means ?

If not how hard is this to do? I can't find any good resources on it anywhere, I get crappy shareware sites.

FearIt
Mar 11, 2007
Hello again CoC,

I'm trying to add a right click JPopupMenu to a JTextArea so that I may easily copy, cut and paste.

I've tried googling for examples but I haven't found any good ones that really fit what I'm trying to do.

Any help would be great. Thanks CoC.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

FearIt posted:

I'm trying to add a right click JPopupMenu to a JTextArea so that I may easily copy, cut and paste.

Read the API docs for JPopupMenu and the tutorial linked from that page about how to use popup menus, and then come back with more specific questions if you're still having trouble.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Sylink posted:

I'm looking at uploading folders/multiple pictures through a java applet and I've never used java before.

Are you new to programming or just to Java?

Anyway, you're not going to be able to read local files from an unsigned applet, and signing is somewhat non-trivial. The search terms you want here are "JFileChooser" and "signed applet".

Facebook might just use JavaScript.

Sylink
Apr 17, 2004

Im completely new to Java, and it seems Java holds the best way to do this.

I think facebook uses java because it loads up the Java machine or w/e with the big coffee logo, unless javascript does that as well?

Would it be easier in Javascript?

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Sylink posted:

I think facebook uses java because it loads up the Java machine or w/e with the big coffee logo, unless javascript does that as well?

That's definitely Java, but it doesn't mean that everything is Java. I don't know.

Sylink posted:

Would it be easier in Javascript?

Can't really answer that; this is out of my area of expertise. Probably, though.

Sylink
Apr 17, 2004

Its looking like it might be easier to just upload a rar or something and take care of it from there.

necrobobsledder
Mar 21, 2005
Lay down your soul to the gods rock 'n roll
Nap Ghost

Sylink posted:

I think facebook uses java because it loads up the Java machine or w/e with the big coffee logo, unless javascript does that as well?

Would it be easier in Javascript?
Whether Java applets (the coffee logo and stomach-churning grind upon load) or Javascript is the right thing to use isn't much different from whether it's better to use Flash or Javascript - they are apples and oranges. Javascript is just the stuff that's written on the client, and if you're doing anything really advanced like encryption algorithms / hand-shaking protocols, I'd suggest not doing it in Javascript. If you're doing some basic text manipulation and maybe some very light image manipulation, Javascript could be the ticket to avoid temporarily turning clients' computers into nuclear reactors.

The most likely case of Java applets being used on Facebook is probably not from Facebook itself but some stupid ad. I can't really think of a good reason why image uploading would need Java on the client end unless you're adding some crazy stuff like photoshop-like features in your web browser.

Image upload functions are typically heavy on the server side, which Javascript doesn't apply to (unless you count stuff like HaXe). So you're probably looking at using a language like PHP, Python, Java, C#, and so forth on the backend to read off your images or zip / rar file that's uploaded. After you pick your language, pick your appropriate megathread and off you go.

lamentable dustman
Apr 13, 2007

🏆🏆🏆

As far as I know you can't upload more then one file at a time in JavaScript/HTML. There are AJAX hacks around this but it is still but you still need to open that dialog box for every single file you want uploaded. If you want to do a batch upload (whole folders or whatever) you would need to use a signed applet

Adbot
ADBOT LOVES YOU

zootm
Aug 8, 2006

We used to be better friends.

necrobobsledder posted:

The most likely case of Java applets being used on Facebook is probably not from Facebook itself but some stupid ad. I can't really think of a good reason why image uploading would need Java on the client end unless you're adding some crazy stuff like photoshop-like features in your web browser.
It's not an ad, it's a multi-file upload system, which is written in Java because...

dvinnen posted:

As far as I know you can't upload more then one file at a time in JavaScript/HTML. There are AJAX hacks around this but it is still but you still need to open that dialog box for every single file you want uploaded. If you want to do a batch upload (whole folders or whatever) you would need to use a signed applet
It's a pity to have to spin up a JVM for such a small use-case but as dvinnen points out it's something that browsers simply can't do.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply