Showing posts with label GUI. Show all posts
Showing posts with label GUI. Show all posts

November 27, 2015

Creating Symbolic Link (Symlink) in Windows 7

Hi friends,

In Linux, it is easy to create symbolic link (symlink) with "ln" command.
But what about in windows?

I found one GUI and command for creating the symbolic links in windows.

Pre-requisites

  1. Visual Studio 2005 redistributable
  2. Link Shell Extension
  3. Download the above executables from here based on OS and system architecture
  4. For Windows 7 64-bit, I have downloaded the following highlighted in black box

Procedure

  • Install the Visual Studio 2005 redistributable
  • Install Link Shell Extension
  • You should be able to see an option in context menu
  • Select the file/folder
  • Right click and select the option "Pick Link Source"

  • Now, the file is been picked
  • Navigate to go the destination folder where you want to create the symbolic link
  • Right click on the empty space of the folder
  • Select Drop As and select "Hardlink or Symbolic Link" based on your requirement


  • You should be able to see the file type as .symlink


References

http://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/

Please send your feedback and comments to psrdotcom@gmail.com

January 09, 2012

Creating basic Graphical User Interface (GUI) application in java with Screenshots

Hi all,

One of my friend asked me, how to create a basic java GUI application which can run on desktop?

A small java gui desktop application, which is having a button and when user click on it, it will show the status of the application.

Source code:

import javax.swing.JFrame;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JOptionPane;

public class PSRSampleGUI
public static void main(String[] args) {
       
        // Creating a frame
        JFrame frame_name = new JFrame("PSR");
      
        //Setting the layout to view the content
        frame_name.setLayout(new FlowLayout());
      
        // Sample lable option
        JLabel label_name = new JLabel("Click Start button");
      
        // Creating a button
        JButton button_name = new JButton("Start");
      
        // Adding button to frame
        frame_name.add(label_name);
        frame_name.add(button_name);
      
        // Adding button functionality
        button_name.addActionListener(new ActionListener()
        {
            @Override
            public void actionPerformed(ActionEvent ae)
            {
                JOptionPane.showMessageDialog(null, "Started", "App Status", JOptionPane.INFORMATION_MESSAGE);
                // Call the method here ( the implemented method)
            }
        });
      
        // Displaying the frame in the center of the screen window
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension windowSize = frame_name.getSize();
        int windowX = Math.max(0, (screenSize.width  - windowSize.width ) / 2);
        int windowY = Math.max(0, (screenSize.height - windowSize.height) / 2);
        frame_name.setLocation(windowX,windowY);
      
        // Displaying the Frame with packing all the contents properly
        frame_name.setVisible(true);
        frame_name.pack();
    } // main method ends here
} // class ends here

Screenshots:
  • By Running the application, you will get the following window in the center of your screen.
  • After clicking on "Start" button, you will get the following window

If you have any queries, please mail to psrdotcom@gmail.com

Featured Post

Java Introdcution

Please send your review and feedback to psrdotcom@gmail.com