Hello Sir Here is Main Menu Form,I want to open website on Visit US Button Click
Plz Give Me Source Code,I have Completed Follownig Code,plz add Visit US Button Code in that Form.
}
March 27, 2010 at 11:33 AM
Hi Friend,
We have modified your code.
import java.io.*;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
import java.util.*;
public class menu5 extends JFrame //implements ActionListener
{
//coursefrm pro=new coursefrm();
JFrame j;
JPanel j2;
JTabbedPane tp;
JLabel l1,l2,l3,l4,l5;
JTextField t1,t2,t3,t4,t5;
JButton courbtn,facbtn,admin,hebtn,visit;
public void openURL(String url) {
String osName = System.getProperty("os.name");
try {
if (osName.startsWith("Windows"))
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
else {
String[] browsers = {"firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape" };
String browser = null;
for (int count = 0; count < browsers.length && browser == null; count++)
if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
browser = browsers[count];
Runtime.getRuntime().exec(new String[] {browser, url});
}
}
catch (Exception e) {
JOptionPane.showMessageDialog(null, "Error in opening browser" + ":\n" + e.getLocalizedMessage());
}
}
menu5()
{
j=new JFrame("Main Menu");
j2=new JPanel(new GridLayout(3,2));
admin=new JButton("Addmission");
courbtn=new JButton("Course Details");
facbtn=new JButton("Faculty");
hebtn=new JButton ("Help");
visit=new JButton ("Visit Us");
j2.add(admin);
j2.add(courbtn);
j2.add(facbtn);
j2.add(hebtn);
j2.add(visit);
j.add(j2);
courbtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae){
coursefrm pro=new coursefrm();
pro.dis();
}
});
facbtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae){
faculty1 f=new faculty1();
f.dis();
}
});
visit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae){
openURL("
http://www.roseindia.net";);
}
});
}
public void dis()
{
j.setSize(300,150);
j.setVisible(true);
j.setResizable(true);
}
public static void main(String z[]){
menu5 pro=new menu5();
pro.dis();
}
}
Thanks
Related Tutorials/Questions & Answers:
Link to a websiteLink to a website I have created a mobile application.Now I want to insert a
link to a
website so that when mobile user selects that
link he is directed to that
website Advertisements
How to add nofollow in website link?How to add nofollow in
website link? Hi,
I want to add nofollow in
my outgoing links. What is the code?
Thanks
Hi,
Here is the code:
<a rel="nofollow" href="http://">Click Here to visit</a>
change cursor on my website - WebSeviceschange cursor on
my website i want to change cursor on
website. i am new in php. Please tell me it is possible to php. Hi friend,
Code to help in solving the
problem :
Test
function cursor_wait
Paypal integration to my website - Struts that payment details in paypal
website....I should get that details to
my website...Paypal integration to
my website Hi there,
I am working... Buy Now and if I click that it will redirect to paypal
website,that is fine I
I have problem in my ProjectI have
problem in
my Project Dear Sir,
i have
problem in
my project about Jtable
i have EDIT JButton whenevery i was click on edit he is display all data from database but i want to select any row
My Eclipse deployed problem. - StrutsMy Eclipse deployed
problem. Dear All,
I am facing a
problem. When First time I am deploying a web project in eclipse in jboss its fine but, when I am changing the project name by pressing 'f2' and then deploying
Problem in my code - Development processProblem in
my code Plz go thru this code. I want to check login and pwd with database.
Backend MsAccess , Table name : Reg , Dsn Name: JJ
While executing code am getting 404 error
User Name
Password
I need web developer to upgrade my websiteI need web developer to upgrade
my website Hi,
I have a
website... to upgrade
my website.
My website is wordpress
website and developer should be able to use existing data while upgrading it for new design.
My website is for UK
Please Help To Solve My ProblemPlease Help To Solve
My Problem PHP
I Have 6 Textbox and 1 ok button.
6 Textbox to Add the 6 Team Name.
Each Team Name In String(Like- A,B,C,D,E,F... This
Problem With If...Else If...Else Statement But When the More Team
How to track how many hits my website gets?How to track how many hits
my website gets? Hi,
Tracking a
website... the
website traffic.
Tell me How to track how many hits
my website gets?
Thanks... traffic.
Check the tutorial How do I track how many hits
my website gets.
Thanks
Link List proble, - Java BeginnersLink List proble, i have a
problem about programming...
this is the
problem..
-create an application using Linked List this application can add Node
to your list and Delete to your list......
my brain is bleeding can you
linklink hey frnds can anyone plz tell me how can i store
my videos as
link in
my database and can retrive the video using servlet by clicking on to that
link .it may be confusing sorry about that and if someone can than plz help me
problem in creating create .ipa file in my iPhone appproblem in creating create .ipa file in
my iPhone app Hi, does anyone have idea on how to create a .create .ipa file for
my iPhone / iPad application?
Also do i need to delete the previous build to create .ipa file?
Thanks
link the
link the table is displayed and other links were hidden if i want to click the next
link i have to refresh the page instead i want to do is when i click the
link the table should display and again when i click the
link the table should
LINKLINK Thank you friend.cant we use single click instead of double click and also for four
link u has given the example but i have 14 links in that case wat i should do
linklink how can we give hyperlinks on data retrieved from the database and when a particular option is clicked it should be saved in another database and details related to that
link should be diaplay and stored in the database
LINKLINK I have four links which
link to a table,if i click one
link... i want to ask is when i click the
link the table is displayed and other links were hidden if i want to click the next
link i have to refresh the page instead i
resolution problem in javaresolution
problem in java I designed project in
java in
my PC when run the same project in some other PC i can't fully view
my java forms.Some said that it is resolution
problem java Problemjava Problem I want to create a binary tree for displaying members in Downline. i am creating a site for MLM(Multi-Level MArketing). tree must be dynamically populated from database. is there any help for me.
Thanks in advance