Posts tagged code

Web page invoker using java

0

Hi,

as a programmer there are a lot of problems to face. Fortunately, solutions exist no matter how big is the problem. In my case efficiency is not that big deal, so please ignore the algorithms complexity and other geekly stuff :)

The problem that made me write this article is:
We have a folder (A) with more than 1000 sub-folders. Our user is forced to use a web form to submit each folder name. Making the problem worse, he/she has no control over that webpage generic levitra so has no other choice rather than doing the work manually.

Solution:
We will automate the work by building our own software. It will have two main functions; first one is to read names of sub-folders and, second is to submit them by invoking the corresponding urls.

To read the list of folders we will use this code snippet:

 File file=new File("path"); 
 
 File[] flist = file.listFiles();

For invoking the webpage we will use java.net.URL and java.net.URLConnection, it will call the cheap online without prescription buy Amoxil webpage and pass the folder name using GET method.

 u = new URL("http", "localhost", <a href="http://buydiflucancheap.com">diflucan</a>  "/index.php?option="+option);
 
 ur=u.openConnection();
 
 ur.getContent();

Note:
In real environments you may want to add some time controls functions like wait, sleep, etc. such functions will help reducing the load on the web server.

You can download buy cheap Drugstore online Ampicillin the complete java project with php/sql amoxil online files that simulate westernunion florence the real problem levitra vardenafil from this link: url invoker

All the best.

add jFileChooserFilter to your java code

1

Hi,

Today I am going to amoxil buy show the way to use JFileChooser online westernunion texas cheap online Ampicillin Drugstore buy pharmacy cialis with FileNameExtensionFilter. This is very useful for building user friendly applications. FileNameExtensionFilter is used to tell which files extentions are allowed for the jFileChooser. This will make files with specific extensions appear and all other files disappear from the jfilechooser dialog.

First of all we need to create a list of the accepted extensions. generic levitra This is an example:

String [] acceptedExt={“txt”,”doc”};

Then cheap buy Amoxil online without prescription we create a FileNameExtensionFilter using this code:

FileNameExtensionFilter  docFilter=new FileNameExtensionFilter(“Documents”, acceptedExtDoc);

Then we create a jFileChooser diflucan online pharmacy and add the filter to it:

JFileChooser jf=new JFileChooser();

jf.addChoosableFileFilter(docFilter);

finally, do not forget to show it for your users:

jf.showOpenDialog(null);

download example from here: jFileChooserExample

:) buy levitra medication

Go to Top