File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Applets alignment. cache & POST Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applets alignment. cache & POST" Watch "Applets alignment. cache & POST" New topic
Author

Applets alignment. cache & POST

Carsten Rasmussen
Ranch Hand

Joined: Sep 22, 2009
Posts: 65
I want to know howto align my radio buttons at center bottom.
I also want to know howto POST from Java Applet to a PHP page.
Last i want to know howto make an applet stop caching so you don't have to close browser to see new content.
Can anybody help ???

Here is my applet code:


I'm new at Java Applets so i properly wont be able to understand unless you keep it simple.
Thanks in advanced.

Carsten S. Rasmussen
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18992
    
    8

Carsten Rasmussen wrote:I want to know howto align my radio buttons at center bottom.


Well, this question isn't specific to applets, it's a general Swing question. The short answer is that you use a suitable layout manager, or combination of layout managers. Here's a link to the Oracle tutorial about layout managers: http://download.oracle.com/javase/tutorial/uiswing/layout/index.html.

I also want to know howto POST from Java Applet to a PHP page.


Likewise this question isn't specific to applets, it can be asked about any Java application which needs to connect to a server. Here's a link to an Oracle tutorial about connecting to URLs and sending and receiving data: http://download.oracle.com/javase/tutorial/networking/urls/index.html. The only applet-related thing is the applet methods getCodeBase() and getDocumentBase() which might help you find your way back to the server from which the applet was downloaded.

Last i want to know howto make an applet stop caching so you don't have to close browser to see new content.


Go to the Java control panel. Select the General tab and click the Settings... button in the Temporary Internet Files section. You will see a Delete Files... button in the popup window, click that and choose the appropriate option from its popup.

You'll notice I linked to several tutorials. Since you're new, the best way to learn about particular topics in Java is to work your way through a tutorial. Work with the code in the tutorial and modify it to do something more like what you want to do, rather than just trying to write code from nothing.
Carsten Rasmussen
Ranch Hand

Joined: Sep 22, 2009
Posts: 65
I want to know how to align my textfield and buttons so far i have manage to make this:


As you can see my button and textfield are align to the left but what if i want to align the button at bottom and textfield at top.
This time i want to see some codes, thank you
your regards Carsten

Ps. this is one of my first java scripts
PPS. i know how to google, i really want to learn ill be your student if possible
PPP: I tried turning off caching on JAVA på i still have to reopen browser to see new content
Andrew Thompson
Ranch Hand

Joined: Aug 05, 2010
Posts: 77
    
    5
Carsten Rasmussen wrote:I want to know how to align my textfield and buttons so far i have manage to make this:

As you can see my button and textfield are align to the left but what if i want to align the button at bottom and textfield at top.


This requirement does not match up with your earlier description about centering radio buttons - since it includes no radio buttons.

Carsten Rasmussen wrote:This time i want to see some codes, thank you


I want a pony. Thanks.

Another way to put that is that you do not always get what you want. The earlier post provided some excellent links that should have been sufficient to solve this problem. *

Carsten Rasmussen wrote:Ps. this is one of my first java scripts


Please refrain from using the term 'scripts' when referring to Java. It is not a scripting language, and the association of 'Java' and 'script' is too often confused with the separate language 'JavaScript'.


* The previous reply was aiming to teach you to fish. OTOH I am willing to 'toss you a fish'. You might think this is more useful, but I feel the first post had far better long term value.

This code puts some radio buttons in the bottom of the applet's content area, centered, as well as the two other controls at the top of the applet, aligned left.

To compile and run it, try something like:



Carsten Rasmussen wrote:PPP: I tried turning off caching on JAVA på i still have to reopen browser to see new content


Those commands will open the applet in the JDK applet viewer. Since the applet viewer does not cache classes, it is a much better development tool than using an actual browser to check changes.



And before I forget. Please choose one form of the two common forms of delimiting code blocks and stick with it. E.G.





Andrew Thompson
http://pscode.org/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applets alignment. cache & POST