Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java GUI
|
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 11th, 2006, 12:52 PM
Registered User
 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Jdialog tabbed panes

import java.awt.event.*;
import java.awt.Color.*;
import javax.swing.*;
import javax.swing.border.*;
import java.io.*;


class FinalSales implements ActionListener
{
    JFrame jf1;
    JTabbedPane main = new JTabbedPane();
    JButton btnLogoff;
    //JButton =new JButton("LogOff");
    //Purchase Form
    JDialog d1;

    FinalSales()
    {
        jf1=new JFrame("Vision Tech software");
        JPanel jp=new JPanel();
        JPanel jp1=new JPanel();
        JPanel jp2=new JPanel();

        d1=new JDialog(jf1,true);

        btnLogoff=new JButton("LogOff");
        btnLogoff.addActionListener(this);

        //jp.add(btnLogoff);
        main.addTab("Login",null,jp1,"Login Details Info");
        main.addTab("Login",null,jp2,"Login Details Info");
        jp.add(jp1);
        jp.add(jp2);


        d1.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_ CLOSE);

        d1.setContentPane(jp);
        d1.setSize(500,500);
        d1.setLocationRelativeTo(null);
        d1.setResizable(false);
        d1.setVisible(true);

        //Action Listeners

    }



    public void actionPerformed(ActionEvent e)
    {
        if(e.getSource()==btnLogoff)
        {
            System.out.println("hellow");
            int choice = JOptionPane.showConfirmDialog (d1,
            "Do you really want to Log-Off" ,
            "Confirm LogOff" , JOptionPane.YES_NO_OPTION);
            if(choice==JOptionPane.YES_OPTION)
                System.exit(0);
        }

    }
    public static void main(String args[])
    {

        new FinalSales();
    }
}



this is my code can i add tabbedPanes to my dialog box

plz Help me TEchies





Similar Threads
Thread Thread Starter Forum Replies Last Post
JDialog hoop_12 Java GUI 0 April 20th, 2006 11:56 AM
tabbed panes in jsp vicelord_shadow JSP Basics 0 February 16th, 2006 06:47 AM
datgrid freeze panes like in excel drachx General .NET 0 July 12th, 2005 01:23 AM
No text in Jdialog poojak16 Java GUI 2 May 23rd, 2005 02:26 AM
i want help about tabbed pane mrafaqi BOOK: Beginning Java 2 0 October 11th, 2003 01:52 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.