<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[JavaRanch: Latest posts for the topic "Scrollbar for jtable"]]></title>
		<link>http://www.coderanch.com/forums/t/2/Swing-AWT-SWT-JFace/Scrollbar-jtable</link>
		<description><![CDATA[Latest messages posted in the topic "Scrollbar for jtable"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[hello friends..<br /> <br /> Please tell me how to add vertical and horizantal scrollbar in jtable?]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2013997</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2013997</link>
				<pubDate><![CDATA[Thu, Jul 2 2009 03:37:58 MDT]]></pubDate>
				<author><![CDATA[janavi patel]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[<pre>panel.add(new JScrollPane(table));</pre><br /> Swing related. Moving.]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014004</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014004</link>
				<pubDate><![CDATA[Thu, Jul 2 2009 03:50:09 MDT]]></pubDate>
				<author><![CDATA[Maneesh Godbole]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Thanks for reply...<br /> <br /> but I already tried everything......and nothing is helpful for me........]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014034</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014034</link>
				<pubDate><![CDATA[Thu, Jul 2 2009 04:21:56 MDT]]></pubDate>
				<author><![CDATA[janavi patel]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Does the panel to which you are adding the table, has a <a href="http://java.sun.com/javase/6/docs/api/java/awt/BorderLayout.html" class="api" title="Java API" target="_new" rel="nofollow">BorderLayout</a>? <br /> It will help us help you better if you <a class="snap_shots" href="http://faq.javaranch.com/java/TellTheDetails" target="_new" rel="nofollow">tell the details</a><br /> Also check out <a class="snap_shots" href="http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch" target="_new" rel="nofollow">this link</a> on how to get the most out of the Ranch.]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014038</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014038</link>
				<pubDate><![CDATA[Thu, Jul 2 2009 04:35:21 MDT]]></pubDate>
				<author><![CDATA[Maneesh Godbole]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Then you're definitely doing something wrong, because the code Maneesh provided should do just what you need.<br /> <br /> Can you show the bit of your code where you add your table to its parent?]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014040</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014040</link>
				<pubDate><![CDATA[Thu, Jul 2 2009 04:36:20 MDT]]></pubDate>
				<author><![CDATA[Rob Prime]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[&gt; but I already tried everything......and nothing is helpful for me........ <br /> <br /> then you're possibly using a null layout, and not giving anything a size.<br /> <br /> we can continue to play 20 guesses, or, if you really want a solution, post your code.]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014043</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014043</link>
				<pubDate><![CDATA[Thu, Jul 2 2009 04:39:38 MDT]]></pubDate>
				<author><![CDATA[Michael Dunn]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Use  this. It will work ..<br /> <br />         <a href="http://java.sun.com/javase/6/docs/api/javax/swing/JScrollPane.html" class="api" title="Java API" target="_new" rel="nofollow">JScrollPane</a> scrollPane = new <a href="http://java.sun.com/javase/6/docs/api/javax/swing/JScrollPane.html" class="api" title="Java API" target="_new" rel="nofollow">JScrollPane</a>(instance_of_Table);<br />         scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);<br />         scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_ALWAYS);<br />          add(scrollPane, BorderLayout.CENTER); (Add should be called for any container....FRame or JPAnel)]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014046</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014046</link>
				<pubDate><![CDATA[Thu, Jul 2 2009 04:42:25 MDT]]></pubDate>
				<author><![CDATA[Rohit Aggarawal]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Or send me your code...]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014047</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014047</link>
				<pubDate><![CDATA[Thu, Jul 2 2009 04:43:21 MDT]]></pubDate>
				<author><![CDATA[Rohit Aggarawal]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Rohit,<br /> Please read this: <a class="snap_shots" href="http://faq.javaranch.com/java/UseTheForumNotEmail" target="_blank" rel="nofollow">http://faq.javaranch.com/java/UseTheForumNotEmail</a>]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014048</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014048</link>
				<pubDate><![CDATA[Thu, Jul 2 2009 04:46:21 MDT]]></pubDate>
				<author><![CDATA[Maneesh Godbole]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[here is my code<br /> <br /> <pre>
class UserPasswardMaster
{
	public static void main(String args[])
	{
		try{
			String Username = &quot;&quot;;
			String Password = &quot;&quot;;
						
			MyFrame8 f8 = new MyFrame8(Username,Password);			
			f8.setSize(500,350);
			f8.show();
		}catch (Exception e){
			System.out.println(&quot;Exception in MyFrame8 is ==&gt;&quot;+e);
		}
	}
}

class MyFrame8 extends JFrame
{
	JPanel p,p1;
	Container c;
	JTable table;
	JTableHeader header;
	DefaultTableModel model;
	JScrollPane pane;

	public MyFrame8(String Username,String Password)   //Constructor
	{
			c = getContentPane();
			p = new JPanel();
			p.setLayout(null);
			p1 = new JPanel();
			p1.setLayout(new BorderLayout());
			
			String data[][] = {};
			String col[] = {&quot;Username&quot;,&quot;Password&quot;};

			model = new DefaultTableModel(data, col);			
			table = new JTable(model)
			{
				public boolean isCellEditable(int rowIndex,int colIndex){
				return false;
			}};
	
			header = table.getTableHeader();
			pane = new JScrollPane(table);

			p1.add(header);
			p1.add(table);
			p1.add(pane);
			
			p.add(p1);
			c.add(p);
	
	}   //Constructor End
}    
</pre>]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014089</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014089</link>
				<pubDate><![CDATA[Thu, Jul 2 2009 05:39:49 MDT]]></pubDate>
				<author><![CDATA[janavi patel]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Ok. I got it...]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014090</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014090</link>
				<pubDate><![CDATA[Thu, Jul 2 2009 05:40:16 MDT]]></pubDate>
				<author><![CDATA[Rohit Aggarawal]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[<pre>
p.setLayout(null);  //Bad idea to set the layout to null. Why are you doing it
p1.add(header);  //1
p1.add(table);  //2
p1.add(pane);  //3 If you do not define the constraints, it defaults to center. Only 1 component can be added. So you end up with the pane
p.add(p1);  
c.add(p);  </pre><br /> <br /> Please see my comments.<br /> Recommendations:<br /> 1) You do not need p. Discard it.<br /> 2) Use p1.add(scrollPane)<br /> 3) Use c.add(p1) <br /> 4) Even, c.add(scrollPane) will do, if your UI shows only the table.<br /> <br /> Recommended reading<br /> <a class="snap_shots" href="http://java.sun.com/docs/books/tutorial/uiswing/components/frame.html" target="_blank" rel="nofollow">http://java.sun.com/docs/books/tutorial/uiswing/components/frame.html</a><br /> <a class="snap_shots" href="http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html" target="_blank" rel="nofollow">http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html</a>]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014097</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014097</link>
				<pubDate><![CDATA[Thu, Jul 2 2009 05:48:03 MDT]]></pubDate>
				<author><![CDATA[Maneesh Godbole]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[I tried this code but this is also not working.....<br /> <pre>
JScrollPane scrollPane = new JScrollPane(instance_of_Table); 
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); 
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_ALWAYS); 
add(scrollPane, BorderLayout.CENTER); (Add should be called for any container....FRame or JPAnel) 
</pre>]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014104</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014104</link>
				<pubDate><![CDATA[Thu, Jul 2 2009 05:52:06 MDT]]></pubDate>
				<author><![CDATA[janavi patel]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Thanks Manish<br /> <br /> but i tried that one also. when i use <a href="http://java.sun.com/javase/6/docs/api/java/awt/BorderLayout.html" class="api" title="Java API" target="_new" rel="nofollow">BorderLayout</a>() it shows empty frame and nothing in it...<br /> <br /> i really fade up of this problem....]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014109</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014109</link>
				<pubDate><![CDATA[Thu, Jul 2 2009 06:00:06 MDT]]></pubDate>
				<author><![CDATA[janavi patel]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[[MG]Edited to remove hijack.<br /> <br /> Danny,<br /> Welcome to the Ranch.<br /> Please start a <a class="snap_shots" href="http://faq.javaranch.com/java/UseOneThreadPerQuestion" target="_new" rel="nofollow">new thread</a> for your question.]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014110</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014110</link>
				<pubDate><![CDATA[Thu, Jul 2 2009 06:00:23 MDT]]></pubDate>
				<author><![CDATA[Dany Rouss]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[<blockquote>
			<div>
				<cite>janavi patel wrote:</cite><br /> but i tried that one also. when i use <a href="http://java.sun.com/javase/6/docs/api/java/awt/BorderLayout.html" class="api" title="Java API" target="_new" rel="nofollow">BorderLayout</a>() it shows empty frame and nothing in it...</div>
		</blockquote><br /> <br /> Like you have been told before, unless you show us your code, we cannot really help you..and even people will get fed up and stop helping you.<br /> So, show us your code  <img src="http://www.coderanch.com/images/smilies/283a16da79f3aa23fe1025c96295f04f.gif" /> ]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014132</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014132</link>
				<pubDate><![CDATA[Thu, Jul 2 2009 06:30:31 MDT]]></pubDate>
				<author><![CDATA[Maneesh Godbole]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[I changed a few things in the code, here is one that works:<br /> <br /> <pre>
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

public class UserPasswardMaster {
	public static void main(String args[]) {
		try {
			String username = &quot;Username&quot;;  
			String password = &quot;Password&quot;;  
			MyFrame8 frame8 = new MyFrame8(username, password);
			frame8.setSize(500, 350);
			frame8.setVisible(true);
		} catch (Exception e) {
			System.out.println(&quot;Exception in MyFrame8 is ==&gt;&quot; + e);
		}
	}
}

class MyFrame8 extends JFrame {
	private JPanel mainPanel;
	private JTable table;
	private JScrollPane pane;

	public MyFrame8(String username, String password) {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		mainPanel = new JPanel();

		String data[][] = {};
		String col[] = { username, password };

		table = new JTable();
		DefaultTableModel dtm = new DefaultTableModel(data, col);
		table.setModel(dtm);
		pane = new JScrollPane(table);
		mainPanel.add(pane);

		add(mainPanel);

	} // Constructor End
}
 
</pre><br /> <br /> I thing you mixed up a few things like:<br /> #             p1.add(header);  <br /> #             p1.add(table);  <br /> #             p1.add(pane);  <br /> you use this only when there is no scrollpane in the table: <a class="snap_shots" href="http://java.sun.com/docs/books/tutorial/uiswing/components/table.html" target="_blank" rel="nofollow">http://java.sun.com/docs/books/tutorial/uiswing/components/table.html</a><br /> <br /> I hope it helps]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014251</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014251</link>
				<pubDate><![CDATA[Thu, Jul 2 2009 08:45:13 MDT]]></pubDate>
				<author><![CDATA[Vandre Caetano]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Here is my another code....<br /> <br /> <pre>
//Write a program that demonstrate jdbc with awt(Inventory)

package components;

import java.io.*;
import java.lang.*;
import java.util.*;
import javax.swing.*;
import javax.swing.JInternalFrame;
import javax.swing.table.*;
import javax.swing.table.DefaultTableModel.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import javax.sql.*;
import javax.swing.JScrollBar.*;

public class UOMMaster  extends JFrame implements MouseListener
{
	JLabel l1,l2;
	JTextField t1,t2;	
	JPanel p;
	Container c;

	JScrollBar pane1;
	//JScrollPane pane1;

	JTable table;
	JTableHeader header;
	DefaultTableModel model;

	Connection con = null;
	Statement stmt = null;
	PreparedStatement pstmt = null;
	ResultSet rs = null;	

	public UOMMaster()   //Constructor
	{
		try
		{
			c = getContentPane();
			p = new JPanel();			
			p.setLayout(null);
			
			String data[][] = {};
			String col[] = {&quot;UOM Code&quot;,&quot;UOM Name&quot;};

			model = new DefaultTableModel(data, col);
			table = new JTable(model)
			{
				public boolean isCellEditable(int rowIndex,int colIndex){
					return false;
			}};

			header = table.getTableHeader();
			p.add(header);
			p.add(table);

			header.setBounds(30,80,350,20);
			table.setBounds(30,80,350,150);

			JScrollBar pane1 = new JScrollBar();
			//table.add(pane1);
			pane1.addAdjustmentListener(this);
			p.add(pane1);
			pane1.setBounds(550,60,20,200);
							

			String data1[][] = {};
			String col1[] = {&quot;UOM Code&quot;,&quot;UOM Name&quot;};
			model1 = new DefaultTableModel(data1, col1);
			table1 = new JTable(model1)
			{
				public boolean isCellEditable(int rowIndex,int colIndex){
					return false;
			}};

			/*pane1 = new JScrollBar(table1,JScrollBar.VERTICAL_SCROLLBAR_ALWAYS,
           JScrollBar.HORIZONTAL_SCROLLBAR_ALWAYS);
			table1.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);*/
			
			header1 = table1.getTableHeader();
			//header1.setBackground(Color.gray);			
			table1.setBackground(Color.lightGray);

			//pane1 = new JScrollPane(table1);
			//pane1 = new JScrollBar(Scrollbar.VERTICAL,1,3,1,12);
			//table1.add(pane1);
			//pane1.setVerticalScrollBarPolicy(JScrollPane .VERTICAL_SCROLLBAR_ALWAYS);
			//p.add(pane1);

			//table1.add(pane1);
			//pane1.add(table1);
			p.add(table1);
			p.add(header1);
			//pane1.setVisible(true);
			
			//pane1.setViewportView(table1);
			//table1.setViewportView(pane1);
			//pane1.addAdjustmentListener(this);
			//table1.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

			
			header1.setBounds(30,80,350,20);
			table1.setBounds(30,80,350,150);

			header1.setVisible(false);
			table1.setVisible(false);		
			
   			
			//c.add(p);  
			c.add(p);

			//Create Buttons
			b1 = new JButton(&quot;Add&quot;);
			b2 = new JButton(&quot;Delete&quot;);			
			b3 = new JButton(&quot;Update&quot;);
			b4 = new JButton(&quot;Clear All&quot;);
			
			//Set Position
			b1.setBounds(35,245,100,20);
			b2.setBounds(125,245,100,20);
			b3.setBounds(215,245,100,20);
			b4.setBounds(305,245,100,20);
						
			//Add Buttons to Panel
			p.add(b1);
			p.add(b2);			
			p.add(b3);
			p.add(b4);
			
			//Create, Set and Add Lables to Panel
			l1 = new JLabel(&quot;UOM Code&quot;);
			l2 = new JLabel(&quot;UOM Name&quot;);
						
			p.add(l1);
			p.add(l2);
														
			//Create, Set and Add TextFields to Panel
			t1 = new JTextField(15);
			t2 = new JTextField(15);
						
			p.add(t1);			
			p.add(t2);			
			
			//Set Position
			l1.setBounds(40,25,100,20);
			t1.setBounds(110,25,250,20);

			l2.setBounds(40,50,100,20);
			t2.setBounds(110,50,250,20);

			//Add Panel to Container
			c.add(p);

			b1.addActionListener(this);
			b2.addActionListener(this);
			b3.addActionListener(this);
			b4.addActionListener(this);
								
			t1.addKeyListener(this);
			table.addMouseListener(this);
			table1.addMouseListener(this);

			String driver = &quot;oracle.jdbc.driver.OracleDriver&quot;;
			String url = &quot;jdbc:oracle:thin:@ERP:1521:priya&quot;;
			String username = &quot;scott&quot;;
			String password = &quot;tiger&quot;;
			Class.forName(driver);		
			System.out.println(&quot;******Driver Loaded*******&quot;);		
			
			con = DriverManager.getConnection(url, username, password);		
			System.out.println(&quot;******Connection Established*******&quot;);
						
			con.setAutoCommit(false);
			
			stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
			
		}//try end
		catch(Exception jkl)
		{System.out.println(&quot;Exception in Action JJKKLL==&gt; &quot;+jkl);}
	
	}   //Constructor End
}
</pre>]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014639</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014639</link>
				<pubDate><![CDATA[Thu, Jul 2 2009 23:24:41 MDT]]></pubDate>
				<author><![CDATA[janavi patel]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Why are you trying to write an entire program when you are trying to learn a new concept?. Your question is about a <a href="http://java.sun.com/javase/6/docs/api/javax/swing/JTable.html" class="api" title="Java API" target="_new" rel="nofollow">JTable</a> and a scrollbar. People have told you to use a <a href="http://java.sun.com/javase/6/docs/api/javax/swing/JScrollPane.html" class="api" title="Java API" target="_new" rel="nofollow">JScrollPane</a>. So only include those two classes in your test programa and keep it simple. Something like this:<br /> <br /> <pre>import java.awt.*;
import javax.swing.*;

public class TableTest2 extends JFrame
{
	public TableTest2()
	{
		JTable 	table = new JTable(20, 5);
		JScrollPane scrollPane = new JScrollPane( table );
		getContentPane().add( scrollPane );
	}

	public static void main(String[] args)
	{
		TableTest2 frame = new TableTest2();
		frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
		frame.setSize(300, 200);
		frame.setLocationRelativeTo( null );
		frame.setVisible(true);
	}
}</pre>]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014645</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014645</link>
				<pubDate><![CDATA[Thu, Jul 2 2009 23:47:31 MDT]]></pubDate>
				<author><![CDATA[Rob Camick]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Are yaar<font color='red'>*</font>.... all things are related and impacting each other...thats why....<br /> <br /> <font color='red'>*Are yaar=="Hey dude" or "Man"</font><br /> <br /> [MG]<br /> Janavi,<br /> We got people from all over the world here.<br /> Please <a class="snap_shots" href="http://faq.javaranch.com/java/UseRealWords" target="_new" rel="nofollow">use real words</a>  <img src="http://www.coderanch.com/images/smilies/283a16da79f3aa23fe1025c96295f04f.gif" /> <br /> [/MG]]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014650</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014650</link>
				<pubDate><![CDATA[Thu, Jul 2 2009 23:52:22 MDT]]></pubDate>
				<author><![CDATA[janavi patel]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Code is slightly modified for the method MyFrame8 and that works now. Please use this piece of code...<br />     <pre>   
   public MyFrame8(String Username, String Password)   //Constructor
    {
        c = getContentPane();
        p = new JPanel();
        p1 = new JPanel();
        p1.setLayout(new BorderLayout());

        String[][] data = {};
        String[] col = {&quot;Username&quot;, &quot;Password&quot;};
        table = new JTable(data,col);
        pane = new JScrollPane(table);
        pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
        pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
        this.add(pane);
    }   //Constructor End
</pre>]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014933</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014933</link>
				<pubDate><![CDATA[Fri, Jul 3 2009 06:19:44 MDT]]></pubDate>
				<author><![CDATA[Rohit Aggarawal]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Rohit,<br /> Please use <a class="snap_shots" href="http://faq.javaranch.com/java/UseCodeTags" target="_new" rel="nofollow">code tags</a><br /> You can add them to your existing post by clicking on the <img src="http://www.coderanch.com/templates/default/images/en_US/icon_edit.gif" border="0" /> button]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014936</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014936</link>
				<pubDate><![CDATA[Fri, Jul 3 2009 06:22:54 MDT]]></pubDate>
				<author><![CDATA[Maneesh Godbole]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Maneesh,<br /> <br /> Done as per your suggestion. <img src="http://www.coderanch.com/images/smilies/3b63d1616c5dfcf29f8a7a031aaa7cad.gif" /><br /> <br /> -Rohit]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014948</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014948</link>
				<pubDate><![CDATA[Fri, Jul 3 2009 06:42:42 MDT]]></pubDate>
				<author><![CDATA[Rohit Aggarawal]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Thank you   <img src="http://www.coderanch.com/images/smilies/e8a506dc4ad763aca51bec4ca7dc8560.gif" /> ]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2014959</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2014959</link>
				<pubDate><![CDATA[Fri, Jul 3 2009 06:53:34 MDT]]></pubDate>
				<author><![CDATA[Maneesh Godbole]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Hi Rohit..<br /> I tried this code:<br /> <br /> <pre>
public MyFrame8(String Username, String Password)   //Constructor   
    {   
        c = getContentPane();   
        p = new JPanel();   
        p1 = new JPanel();   
        p1.setLayout(new BorderLayout());   
  
        String[][] data = {};   
        String[] col = {&quot;Username&quot;, &quot;Password&quot;};   
        table = new JTable(data,col);   
        pane = new JScrollPane(table);   
        pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);   
        pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);   
        this.add(pane);   
    }   //Constructor End  
</pre><br /> <br /> but still its not showing a table and positions of all other components is different because of  p = new <a href="http://java.sun.com/javase/6/docs/api/javax/swing/JPanel.html" class="api" title="Java API" target="_new" rel="nofollow">JPanel</a>();  ....<br /> <br /> and if I used  p = new <a href="http://java.sun.com/javase/6/docs/api/javax/swing/JPanel.html" class="api" title="Java API" target="_new" rel="nofollow">JPanel</a>(null);  then components positions are right as they defined but still not showing a table.......<br /> ]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2015326</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2015326</link>
				<pubDate><![CDATA[Sat, Jul 4 2009 03:31:12 MDT]]></pubDate>
				<author><![CDATA[janavi patel]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Did you try out Rob Camick's code? ]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2015333</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2015333</link>
				<pubDate><![CDATA[Sat, Jul 4 2009 03:43:57 MDT]]></pubDate>
				<author><![CDATA[Maneesh Godbole]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Yes, I tried that.....<br /> It works when there is only container and not panel and it hides all other components....<br /> And when panel is used all positions are proper bue there is no scrollbar....]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2015345</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2015345</link>
				<pubDate><![CDATA[Sat, Jul 4 2009 04:44:02 MDT]]></pubDate>
				<author><![CDATA[janavi patel]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[&gt; Yes, I tried that.....<br /> <br /> and, as usual, it worked.<br /> <br /> <br /> &gt; It works when there is only container and not panel and it hides all other components....<br /> &gt; And when panel is used all positions are proper bue there is no scrollbar....<br /> <br /> then, why don't you post your (altered Rob Camick's) code to prove the above?]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2015349</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2015349</link>
				<pubDate><![CDATA[Sat, Jul 4 2009 04:52:29 MDT]]></pubDate>
				<author><![CDATA[Michael Dunn]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Dear janavi patel <br /> <br /> You can use the modified code that was posted by me earlier and It will run like anything. I took not more than 1 minute to modiffy and run your code. <br /> I am still wondeing why that does not work on your machine.   <img src="http://www.coderanch.com/images/smilies/2786c5c8e1a8be796fb2f726cca5a0fe.gif" /><br /> <br /> -Rohit]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2015901</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2015901</link>
				<pubDate><![CDATA[Sun, Jul 5 2009 21:36:34 MDT]]></pubDate>
				<author><![CDATA[Rohit Aggarawal]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA["Rohit agl",<br /> Please check your <a class="snap_shots" href="http://www.coderanch.com/forums/pm/inbox" target="_new" rel="nofollow">private messages</a> for an important administrative matter.]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2015993</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2015993</link>
				<pubDate><![CDATA[Mon, Jul 6 2009 01:10:10 MDT]]></pubDate>
				<author><![CDATA[Maneesh Godbole]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Hi Rohit<br /> I tried your code snippet in my program as follows:<br /> <pre>
public MyFrame8(String Username,String Password)   //Constructor
	{
		try
		{
			String data[][] = {};
			String col[] = {&quot;Username&quot;,&quot;Password&quot;};
			model = new DefaultTableModel(data,col);			
			table = new JTable(model)
			{
				public boolean isCellEditable(int rowIndex,int colIndex){
				return false;
			}};
	
			pane = new JScrollPane(table);   
			pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);   
			pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
			
			c = getContentPane();
			getContentPane().add(pane);
			p = new JPanel();			
			p.setLayout(null);
			//p.setLayout(new BorderLayout());
			
			//pane.setBounds(20,125,460,140);
			//header.setBounds(20,125,450,25);
			//table.setBounds(20,150,450,130);
			
			//Create Buttons
			b1 = new JButton(&quot;Add&quot;);
			b2 = new JButton(&quot;Delete&quot;);			
			b3 = new JButton(&quot;Update&quot;);
			b4 = new JButton(&quot;Clear All&quot;);
			
			//Set Position
			b1.setBounds(38,300,90,25);
			b2.setBounds(148,300,90,25);
			b3.setBounds(258,300,90,25);
			b4.setBounds(368,300,90,25);
						
			//Add Buttons to Panel
			p.add(b1);
			p.add(b2);			
			p.add(b3);
			p.add(b4);
			
			//Create, Set and Add Lables to Panel
			l1 = new JLabel(&quot;Username&quot;);
			l2 = new JLabel(&quot;Password&quot;);
						
			p.add(l1);
			p.add(l2);
														
			//Create, Set and Add TextFields to Panel
			t1 = new JTextField(20);
			t2 = new JTextField(20);
						
			p.add(t1);			
			p.add(t2);			
			
			//Set Position
			l1.setBounds(125,30,80,25);
			t1.setBounds(205,30,160,25);

			l2.setBounds(125,70,80,25);
			t2.setBounds(205,70,160,25);

			//Add Panel to Container
			c.add(p);			
			
		}//try end
		catch(Exception jkl)
		{System.out.println(&quot;Exception in Action JJKKLL==&gt; &quot;+jkl);}
	
	}   //Constructor End
</pre><br /> <br /> 1. Now it adds scrollpane to the table but not showing other components.<br /> 2. Also shows srollable table for full frame. For this I tried pane.setBounds() but no effect.<br /> 3. Doesn't matters panel's layout even whether panel is used or not.<br /> <br /> <br /> ]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2016705</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2016705</link>
				<pubDate><![CDATA[Tue, Jul 7 2009 00:23:27 MDT]]></pubDate>
				<author><![CDATA[janavi patel]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[<blockquote>
			<div>
				<cite>janavi patel wrote:</cite><br /> 1. Now it adds scrollpane to the table but not showing other components.<br /> 2. Also shows srollable table for full frame. For this I tried pane.setBounds() but no effect.<br /> 3. Doesn't matters panel's layout even whether panel is used or not.<br /> </div>
		</blockquote><br /> <br /> I am not surprised. You have chosen to ignore the hints/ready made code provided to you.<br /> Recommended reading<br /> <a class="snap_shots" href="http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html" target="_blank" rel="nofollow">http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html</a>]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2016712</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2016712</link>
				<pubDate><![CDATA[Tue, Jul 7 2009 00:36:28 MDT]]></pubDate>
				<author><![CDATA[Maneesh Godbole]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[manish<br /> this is last time I am telling to you I tried all hints and every other thing that I can do...<br /> if you cant help or dont want to help then its more better for both of us that you just stay away from this matter.......]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2016720</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2016720</link>
				<pubDate><![CDATA[Tue, Jul 7 2009 00:51:26 MDT]]></pubDate>
				<author><![CDATA[janavi patel]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[<blockquote>
			<div>
				<cite>janavi patel wrote:</cite>manish<br /> this is last time I am telling to you I tried all hints and every other thing that I can do...<br /> if you cant help or dont want to help then its more better for both of us that you just stay away from this matter.......</div>
		</blockquote><br /> <br /> To start with I am a volunteer here and I do not get paid for this work. Even if I was getting paid, I still do not have any reason to put up with this kind of language. <br /> I do not see you trying out my suggestions which I gave <a class="snap_shots" href="http://www.coderanch.com/forums/posts/list/452229#2014097" target="_new" rel="nofollow">here</a> I wonder if you found time to go through the links I had provided.<br /> Michael Dunn (another volunteer) had requested you to <blockquote class="uncited">
			<div>then, why don't you post your (altered Rob Camick's) code to prove the above?<br />  </div>
		</blockquote>. You did not respond to it. BTW, Rob Camick is another volunteer.<br /> <br /> If you want to learn, it might be a good idea to try out suggestions. You can always ask why. If you want ready made solutions (and the learning is not really important), then you are in the wrong place. All volunteers here are entitled to some respect.<br /> <br /> Have a nice day and best of luck with your code.]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2016730</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2016730</link>
				<pubDate><![CDATA[Tue, Jul 7 2009 01:01:54 MDT]]></pubDate>
				<author><![CDATA[Maneesh Godbole]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[sorry for that.....<br /> actually I never behave like this with anyone but everytime manish replied against me.....<br /> everytime i said i tried and you just opposed me and nothing else thats why...........<br /> and in my code i did too many changes so its not possible for me to send the code......<br /> and I want to learn thats why I am doing all these things.......<br /> <br /> sorry once again......<br /> and I m saying sorry not because you are a volunteer but because of this is not in my nature.......<br /> ]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2016745</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2016745</link>
				<pubDate><![CDATA[Tue, Jul 7 2009 01:13:52 MDT]]></pubDate>
				<author><![CDATA[janavi patel]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[<blockquote class="uncited">
			<div>I did too many changes so its not possible for me to send the code...... </div>
		</blockquote><br /> <br /> You learn by walking, not running. <b>Forget about your real program,</b> you are just trying to learn basic concepts, so you start with a basic program.<br /> <br /> Why do you think I gave you the 10 line complete example program?<br /> <br /> That program shows how to display a table with scrollbars. The next step is to add a couple of text fiields. If it works great, if not, then you have a 10-15 line program to post in the forum that we can look at. Once that works you move on to the next step.<br /> <br /> Finally, when you understand how LayoutMangers work and how to you add components to a panel you go back to your real program to figure out what you did wrong. We are not here to debug you program for you. Frankly, if you can't figure out how to add components to a panel then you shouldn't be doing Swing programming. This should be the first think you learn because it only gets more difficult.]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2017132</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2017132</link>
				<pubDate><![CDATA[Tue, Jul 7 2009 08:52:37 MDT]]></pubDate>
				<author><![CDATA[Rob Camick]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[&gt; actually I never behave like this with anyone but everytime manish replied against me..... <br /> <br /> you've missed the point, totally. There's nothing 'personal' in it.<br /> <br /> all everyone is doing is trying to get you to think about what you're doing, how you're going about it,<br /> giving you some hints/nudges in the right direction. <br /> This makes it much easier for you the next time you have a problem.<br /> <br /> ]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2017322</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2017322</link>
				<pubDate><![CDATA[Tue, Jul 7 2009 13:11:55 MDT]]></pubDate>
				<author><![CDATA[Michael Dunn]]></author>
			</item>
			<item>
				<title>Scrollbar for jtable</title>
				<description><![CDATA[Another problem is that you're creating and displaying your GUI objects in the main thread. All that should really be done in the event dispatching thread. If you're using java6, try <a class="snap_shots" href="http://java.sun.com/javase/6/docs/api/javax/swing/SwingUtilities.html#invokeLater(java.lang.Runnable)" target="_new" rel="nofollow">http://java.sun.com/javase/6/docs/api/javax/swing/SwingUtilities.html#invokeLater(java.lang.Runnable)</a>]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/452229/2017475</guid>
				<link>http://www.coderanch.com/forums/posts/preList/452229/2017475</link>
				<pubDate><![CDATA[Tue, Jul 7 2009 17:31:42 MDT]]></pubDate>
				<author><![CDATA[Dipanjan Kailthya]]></author>
			</item>
	</channel>
</rss>
