Click here to Skip to main content
Email Password   helpLost your password?

Sample Image - tabcontrol.gif

Introduction

Dear Friends,
        This is one of most wanted component in Java Programming World..  
Here,
  I am using the Card Layout for developing this component. Download the project files and run the run.bat file to get the output.

Explanation

The Following files are used in the Tab Control.
Border.java
BorderPanel.java
Scrollbar.java
    - These Files are Used For crating a Customized Scroll Bar.. 
Scrollpanel.java
   - This is used bar embeding a customized scroll bar into Panel.
TabPanel.java 
  - This is used for creating tabs. That Source Code is as follows

chatClient1.java
  - is Main Applet
Here, This is source for setting Tab Panel

Source Code

import java.awt.Panel;
import java.awt.CardLayout;
import java.awt.BorderLayout;
import java.awt.*;
import java.awt.event.*;
public class TapPanel extends Panel
{
TapPanel(chatClient1 app)
{
	  // Initialize the Components

	  chatclient = app;	
	  // Main Panel

	  RightPanel = new CPanel(300, 500);
	    	    
      Panel panel2 = new Panel();
      CardLayout cardlayout = new CardLayout();
      panel2.setLayout(cardlayout);
      UserPanel = new Panel();	  
      UserPanel.add("Center",new Label("User"));
	  	  	
      ImgScrollPanel = new Panel();
	  ImgScrollPanel.setLayout(new BorderLayout());
	         
      BuddyPanel = new Panel();
	  BuddyPanel.setLayout(new BorderLayout());
	  
	  RoomPanel = new Panel();
	  RoomPanel.setLayout(new BorderLayout());
	  
	  panel2.add("UserPanel", UserPanel);
	  panel2.add("RoomPanel", RoomPanel); 
      panel2.add("ImgScrollPanel", ImgScrollPanel); 
      panel2.add("BuddyPanel", BuddyPanel);

      cardlayout.show(panel2, "UserPanel");

      RightTab = new BorderPanel(this,chatclient, cardlayout, panel2, 210, 270);
	  
      RightTab.addTab("USERS", "UserPanel");
      RightTab.addTab("ROOMS", "RoomPanel"); 
      RightTab.addTab("IMAGES", "ImgScrollPanel");
      RightTab.addTab("BUDDY", "BuddyPanel");
      RightPanel.add(RightTab);
      add(RightPanel);  
}

Panel LeftPanel,BuddyPanel,RoomPanel,ImgScrollPanel,UserPanel;
CPanel RightPanel;
BorderPanel RightTab;
chatClient1 chatclient;
public int i;
}

Finally,

If U want Panel ,You can Add as a Tabs. Finally , in Your Applet or the Main Application, U Just call like tab = new TapPanel(this); then, it will embed it into ur Applet.

Jeeva S

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
GeneralCode java of Chat program
thopt
8:51 3 Nov '09  
Could you send me a full source of Chat program by java,please?
I like your chat program very much!!!
Thank you very much.........!!!!!!! Wink Wink
GeneralNew in Java [modified]
askPrins
10:30 17 Jul '08  
Hi Jeeva,
Thanks for sharing. I found some great stuff which makes my life much easierSmile
A question: Which tools(e.g. NetBeans etc) do you use/prefer for developing Java projects?
Best regards
Sascha

modified on Friday, July 18, 2008 11:17 AM

GeneralHey!
138256ssn
9:03 16 Sep '07  
There is no source code in your zip file.
GeneralRe: Hey!
askPrins
10:11 17 Jul '08  
Look to the Java Chat With Customizable GUI.
General*-- How to GET the SOURCE CODE -- *
theo251
2:35 21 Feb '07  
Use "JCavaj"
Generalhave the coding
coool_ajit
20:44 17 Apr '06  
hi
i like to have the coding of chat server so please send me the coding of it
thankyou


dasssssdsadasdasd
Generalplz send
ashishkumar.er
6:59 20 Mar '06  
hello sir
there is no source file,there are only class file
sir i need source file if u read this message
plz send me
my email id is ashishkumar.er@gmail.com

plz send me code of this
GeneralThere is an error in your run.bat file
code rider
20:30 17 Oct '04  
you called chatClient1.java which is not correct in order to run the class you need to call it in htm as an object, and then you need to pass it to appletviewer(i mean the name and extension of the htm file) here is a sample code

for run.bat write this
appletviewer myApplet.htm

for htm file here is the sample code

<html>

<applet code="chatClient1.class" height=300 width=400>

</applet>
</html>

name this htm file as .htm

where some-name is any name that you want to give to your htm file

GeneralNo Source files!?
T.Haberkern
1:39 19 Apr '02  
There are only class files in the zip-package
GeneralRe: No Source files!?
tedyoung
11:36 2 Dec '03  
Yeah! Where are the source files? There aren't any in the ZIP.
Generalhttp://www.codeproject.com/useritems/java_applet_chat_with_gui.asp
Altair_Liu
19:47 12 Oct '04  
http://www.codeproject.com/useritems/java_applet_chat_with_gui.asp[^]
GeneralRe: http://www.codeproject.com/useritems/java_applet_chat_with_gui.asp
ksnare
6:41 29 May '08  
This did not work for me. I still can't get the zip files


Last Updated 18 Apr 2002 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2010