Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Create Manifest File for Your Jar File

Open notepad and Save it as Manifest.mf

And copy it and paste int your File change <Your Class name in Main function Exists> to your  main class name.<enter> is your keyboard Enter key.

 

 

 

Manifest-Version: 1.0

Created-By: 1.7.0-ea (Sun Microsystems Inc.)

Main-Class: <Your Class name in Main function Exists>

<enter>

<enter>

<enter>

 

 

 

Example:

 

                                                Manifest.mf

Manifest-Version: 1.0

Created-By: 1.7.0-ea (Sun Microsystems Inc.)

Main-Class: Login

<enter>

<enter>

<enter>

 

 

 

 

 

Want to Creat Executable Jar file for your Application

Syntax :
                                jar cfm <FileName>.jar <ManifestFileName>.extension <filename.extension> <filename.extension> <filename.extension>……….






Here jar is command to create jar file.


<FileName>.jar is your jar file name.


<ManifestFileName>.extension is your ManifestFile Name.


<filename.extension> is whose filename to want to add in your jar file.


Example:
C:\jar cfm Login.jar Manifest.mf Login.class SplaceScreen.class *.class




If you have any query about that then contact me at wasim.akh2@gmail.com





Run cmd command from java

import java.io.*;

import java.util.*;

public class CmdVerJavaDemo{

BufferedReader x=new BufferedReader(new InputStreamReader(System.in));

Runtime myrun;

Process output;

public static void main(String args[])throws IOException

{

(new CmdVerJavaDemo()).runCmdCommand("dir *.*");

}

public void runCmdCommand(String cmd)throws IOException

{

System.out.println("Your Cmd Command is "+cmd);

myrun=Runtime.getRuntime();

output=myrun.exec("cmd /c "+cmd);

String outStr="";

String fDate="";

String fName="";

x=new BufferedReader(new
InputStreamReader(output.getInputStream()));

for(int i=0;i<=100 && outStr!=null;i++)

{

outStr=x.readLine();

if(outStr==null)

{

System.out.println("File Data has null
.");

}

else

{

System.out.println(outStr);

StringTokenizer strToken=new
StringTokenizer(outStr);

int countT=strToken.countTokens();

if(i>=6)

{


fDate=strToken.nextToken();


fName=strToken.nextToken();


fName=strToken.nextToken();


fName=strToken.nextToken();


fName=strToken.nextToken();


fDate=fDate.replaceAll("/","-");


System.out.println("File Name :"+fName);


System.out.println("File Date :"+fDate);


output=myrun.exec("cmd /c md backup");


output=myrun.exec("cmd /c copy .\\*.* .\\backup");


output=myrun.exec("cmd /c md "+fDate);

File
fileName=new File(fName);


if((fileName.isDirectory()))


System.out.println("File Name :"+fName+" is Directory");

else


{


System.out.println("File Name :"+fName+" is File");


output=myrun.exec("cmd /c copy .\\"+fName+" .\\"+fDate);


}

}

}

}

}

}

What Is JavaFX

What Is JavaFX


JavaFX extends your web experience by delivering rich media and content across all the screens of your life. As users, you will be able to run JavaFX applications in a browser or drag and drop them onto the desktop. It's a seamless interface!
JavaFX is powered by Java: JavaFX extends the power of Java by allowing developers to use any Java library within JavaFX applications. This way developers can expand their capabilities in Java and make use of the revolutionary presentation technology that JavaFX provides to build engaging visual experiences.
Highlights of JavaFX:
    • Allows users to view JavaFX applications in a browser or break free of the browser by dragging and dropping the same application onto the desktop
    • Enables an efficient designer-to-developer workflow with Project Nile: designers can work in their tools of choice while collaborating with Web scripters who use the NetBeans IDE with JavaFX
    • Extends Java technology by enabling use of any Java library within a JavaFX application
    • Allows developers to integrate vector graphics, animation, audio, and video Web assets into a rich, interactive, immersive application
To learn more about JavaFX technology, visit javafx.com or java.sun.com/javafx web sites for more information.

JavaFX extends your web experience by delivering rich media and content across all the screens of your life. As users, you will be able to run JavaFX applications in a browser or drag and drop them onto the desktop. It's a seamless interface!

JavaFX is powered by Java: JavaFX extends the power of Java by allowing developers to use any Java library within JavaFX applications. This way developers can expand their capabilities in Java and make use of the revolutionary presentation technology that JavaFX provides to build engaging visual experiences.

Highlights of JavaFX:

  • Allows users to view JavaFX applications in a browser or break free of the browser by dragging and dropping the same application onto the desktop
  • Enables an efficient designer-to-developer workflow with Project Nile: designers can work in their tools of choice while collaborating with Web scripters who use the NetBeans IDE with JavaFX
  • Extends Java technology by enabling use of any Java library within a JavaFX application
  • Allows developers to integrate vector graphics, animation, audio, and video Web assets into a rich, interactive, immersive application

To learn more about JavaFX technology, visit javafx.com or java.sun.com/javafx web sites for more information.

--  MD WASHIM AKHTAR

Why Software Developers Choose Java

Why Software Developers Choose Java

Java has been tested, refined, extended, and proven by a dedicated community. And numbering more than 6.5 million developers, it's the largest and most active on the planet. With its versatilty, efficiency, and portability, Java has become invaluable to developers by enabling them to:

  • Write software on one platform and run it on virtually any other platform
  • Create programs to run within a Web browser and Web services
  • Develop server-side applications for online forums, stores, polls, HTML forms processing, and more
  • Combine applications or services using the Java language to create highly customized applications or services
  • Write powerful and efficient applications for mobile phones, remote processors, low-cost consumer products, and practically any other device with a digital heartbeat
--  MD WASHIM AKHTAR

How to Develop a Signed Applet

How to Develop a Signed Applet

Read/write the local machine file system using a signed applet
Introduction
The information in this article helps in answering the following questions:
  • What are the tools needed to develop a signed applet?
  • How to make a test certificate using Microsoft Sign Tool?
  • How to read/write the local machine file system using a signed applet?
Summary
This article shows how to develop a signed applet using the Microsoft sign Tool.
Reading and writing file system through an applet is possible provided you have signed that applet using Microsoft Sign tool for Internet Explorer or Netscape sign tool for Netscape. The example that I showed here is just an example of how to create a test certificate. This is not recommended if you are going to publish your applet over the Web. In that case, you will have to get the certificate from Verisign or Thawte certificate for publishing. Unless the content in your applet is insecure, it may corrupt itself or corrupt other resources where it is playing.
Tools Required
  • Microsoft Internet Explorer 3.0 or upgrade version
  • Microsoft Sign tool which encompasses the following EXEs and DLLs
    • makecert.exe
    • signcode.exe
    • setreg.exe
    • ChkTrust.exe
    • cert2spc.exe
    • cabarc.exe
    • javasign.dll
    • signer.dll
More Information
Part I: Java Applet Read/Write File System using Applet
Part I provides the source code for the read/write applet.
Collapse
import java.applet.*;import com.ms.security.*;import java.awt.*;import java.io.*;import java.lang.*;import java.applet.*;
public class WriteFile extends Applet
{
    String myFile =
"G:\\test.foo";
    File f =
new File(myFile);
    DataOutputStream dos;
public void paint(Graphics g)
    {
       
try
        {
         
//create the output stream   
          dos =
new DataOutputStream(new BufferedOutputStream
                (
new FileOutputStream(myFile),128));
         
//write chars to that file       
          dos.writeChars(
"Cats can hypnotize you when you least expect it\n");
         
//flush stream to that file
          dos.flush();
          g.drawString(
"Successful attempt to write to " + myFile, 10, 10);
        }
       
catch (SecurityException e)
        {
              g.drawString(
"writeFile: caught security exception", 10, 10);
            }
catch (IOException ioe)
        {
        g.drawString(
"writeFile: caught i/o exception", 10, 10);
            }   
    }
}
--  MD WASHIM AKHTAR

Microsoft Copilot Showing on Installed Apps in Windows 10/11 Settings

UPDATE: Microsoft has resolved the issue by releasing an update for Edge browser on April 26, 2024. Microsoft Edge version 124.0.2478.67 rem...