₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,324,999 members, 8,419,865 topics. Date: Thursday, 04 June 2026 at 05:02 AM

Toggle theme

Java Programmers Please Help - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingJava Programmers Please Help (978 Views)

1 Reply (Go Down)

Java Programmers Please Help by klark3(op): 10:02am On Jun 21, 2015

I'm currently working on a java desktop application project and I'm using netbeans 8.0 IDE .. I'm trying to implement an Action Listener to open a web link on the user default web browser when a jbutton is clicked . i have tried so many online tutorials but nothing seems to be working . please how do i implement this on netbeans 8.0 IDE and make it work ..





Re: Java Programmers Please Help by GuiltySpark343(m): 12:42am On Jun 22, 2015
am an intermediate level java SE (i havent entered EE) programmer...Hhmm this requires an expert level programmer...Hhmm two independent programmes interacting with each other...normally what programmes do is to use hardware resources to accomplish tasks...try googling it and see if somebody has asked similar question especially on a "stackoverflow"
Re: Java Programmers Please Help by javadoctor(m): 6:20am On Jun 22, 2015
jButton1.addActionListener(new ActionListener(){

public void actionPerforned(){

// execute bash script

String command = "chrome http://www.google.com";

new ExecuteShellCommand.executeCommand(command);
}

}




);
Re: Java Programmers Please Help by GuiltySpark343(m): 7:36am On Jun 22, 2015
javadoctor:
jButton1.addActionListener(new ActionListener(){

public void actionPerforned(){

// execute bash script

String command = "chrome http://www.google.com";

new ExecuteShellCommand.executeCommand(command);
}

}




);
Bad

I declare this thread closed

but what does the chrome in the string declaration stand for
Re: Java Programmers Please Help by Knownpal(m): 9:07am On Jun 22, 2015
Use desktop integration. //googleOut
Re: Java Programmers Please Help by seunthomas: 9:13am On Jun 22, 2015
javadoctor:
jButton1.addActionListener(new ActionListener(){

public void actionPerforned(){

// execute bash script

String command = "chrome http://www.google.com";

new ExecuteShellCommand.executeCommand(command);
}

}




);
Good job this will fail if chrome is not installed on the system(Many new systems dont have chrome).

import java.awt.Desktop;
import java.net.URI;


jButton1.addActionListener(new ActionListener(){

public void actionPerforned(){

// execute bash script

//String command = "chrome http://www.google.com";

//new ExecuteShellCommand.executeCommand(command);
if(Desktop.isDesktopSupported())
{
Desktop.getDesktop().browse(new URI("http://www.example.com"));
}

}

}
//CREDIT GOES TO javadoctor:





);
Re: Java Programmers Please Help by Foxybone(m): 7:25pm On Jun 22, 2015
javadoctor:
jButton1.addActionListener(new ActionListener(){

public void actionPerforned(){

// execute bash script

String command = "chrome http://www.google.com";

new ExecuteShellCommand.executeCommand(command);
}

}




);
Uhm, had to poke my nose here... I think I will have to get comfortable in this section. please welcome me ohh cos this is where my future lie..
Re: Java Programmers Please Help by Nigara: 2:05pm On Jun 23, 2015
javadoctor:
jButton1.addActionListener(new ActionListener(){

public void actionPerfor n ed(){

// execute bash script

String command = "chrome http://www.google.com";

new ExecuteShellCommand.executeCommand(command);
}

}




);
bro debug you post... cheesy
1 Reply

Java Programmers ,I Need Help Fixing This Code.How Long Did It Take You Guys To Become Strong Java ProgrammersAndroid Java Programmers, Please Help Me Look Into This234

Internship OpportunityPls I Need Pcb Board Control Panel**picture Attached Too The PostHow To Get A Free Logo For Your Web Project,blog Or Website Here On Nairaland