How to Open a Text File with Notepad using JAVA in NetBeans

  Рет қаралды 35,946

raksrahul

raksrahul

Күн бұрын

How to Open a Text File with Notepad using JAVA in NetBeansIDE.
Here I used Runtime class and Process class to execute the command for opening notepad
1. Create a main class.
2. Enter code in main method {
Runtime rt=Runtime.getRuntime();
String file="path of your file";
Process p=load.exec("notepad "+file); // a space is required after notepad
3. Run the File.
4. Finish
To open Firefox, IExplorer or other browser with required page(url):
Process p=load.exec("path to browser executable file "+url); //url is the page to open
Follow us on :
Facebook : / raksrahul-100219708647780
Instagram : / raksrahul_ig
#Java #LearnJava #NetBeansIDE

Пікірлер: 25
@NargaKuruga
@NargaKuruga 4 жыл бұрын
Thank you very much it worked !
@raksrahul
@raksrahul 4 жыл бұрын
Glad it helped
@elricman1865
@elricman1865 10 жыл бұрын
thanks man I LOVE YOU!!!!
@Amit.Thinks
@Amit.Thinks 11 жыл бұрын
nice video, can we do the same thing at runtime, i.s. while integerating appletproject with WebApplicationProject in NetbeansIDE using appletproject jar file in WebApplicationProject
@guismoreira
@guismoreira 5 жыл бұрын
thanks my friend
@raksrahul
@raksrahul 4 жыл бұрын
Welcome 🙂
@Hoptipotamus
@Hoptipotamus 11 жыл бұрын
Worked for me as long as encased it in a try catch for IOException. Otherwise thanks alot! :D
@raksrahul
@raksrahul 11 жыл бұрын
In Windows 7 and with Microsoft Office 2007: Runtime load=Runtime.getRuntime(); String file="excelfile.xlsx"; //Path to your excel file load.exec("C:\\Program Files\\Microsoft Office\\Office12\\EXCEL.exe "+file); //Path to 'Excel.exe'
@ayanadhami4759
@ayanadhami4759 8 жыл бұрын
you make me remind of a crooked man, the way you were shivering your hands.
@Amit.Thinks
@Amit.Thinks 11 жыл бұрын
thanks bro, I've mailed you :)
@siddhantkumar7257
@siddhantkumar7257 9 жыл бұрын
thanks.... biraathar....... :p
@abdulhadiahmadfauzi
@abdulhadiahmadfauzi 10 жыл бұрын
hi just wanna ask if for Ubuntu still the same ? this one is for windows enviroment right ?
@raksrahul
@raksrahul 10 жыл бұрын
Yes, this one is for windows.
@abdulhadiahmadfauzi
@abdulhadiahmadfauzi 10 жыл бұрын
i have try for ubuntu but cant open the bash file
@dgborse1855
@dgborse1855 10 жыл бұрын
thnx bro!!!!!!!!!!
@TejoAgus
@TejoAgus 11 жыл бұрын
I need to open an Excel file, any idea of how to do so?
@dragonliteboy
@dragonliteboy 8 жыл бұрын
thanks!
@narendraverma825
@narendraverma825 10 жыл бұрын
video is good thanks i have one question i have pdf file i want to open(C:\\Users\\pdfopen.pdf) .this file is opening but its in notepad .i want in pdf please help me
@raksrahul
@raksrahul 11 жыл бұрын
I did not get what actually you want to do? But.. You can do the same at runtime. Just put the code in any method called at runtime by an event.
@HDDIAMONDS69
@HDDIAMONDS69 11 жыл бұрын
i have a notepad file and i want to open it with java platform help
@raksrahul
@raksrahul 11 жыл бұрын
If u want to open file with notepad, the current video is sufficient,if u want to open file in java, simply u can read it with java.io.FileReader/FileInputStream.
@raksrahul
@raksrahul 11 жыл бұрын
Check : 1. ur code. 2. u have specified the file path not directory path in your program. 3. u have permission to access the file.
@Amit.Thinks
@Amit.Thinks 11 жыл бұрын
Hi raksrahul, can you please provide me your email-d? I can send you the description, just stucked in something related to netbeans web application project.
@raksrahul
@raksrahul 11 жыл бұрын
rahulraks4u@gmail.com
how to write data in file in java using netbeans IDE
4:18
Jump to Programming World
Рет қаралды 4,3 М.
Java File Input/Output - It's Way Easier Than You Think
8:18
Coding with John
Рет қаралды 516 М.
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
Java FileWriter (write to a file) 📝
3:51
Bro Code
Рет қаралды 103 М.
Writing Code That Runs FAST on a GPU
15:32
Low Level
Рет қаралды 579 М.
SFTP in Java | JSch | SSH Java
11:18
raksrahul
Рет қаралды 8 М.
Files In Java - Read Text File Easily #38
7:48
Alex Lee
Рет қаралды 551 М.
Difference between BufferedReader and Scanner in java
7:19
learnprograming byluckysir
Рет қаралды 19 М.
Debugging C# Code in Visual Studio | Mosh
31:42
Programming with Mosh
Рет қаралды 394 М.