Scroll in JPanel

Ads
 

Scroll in JPanel

Hello sir,
View Answers

October 18, 2010 at 5:01 PM

Hi Friend,

You can use the following code:

import java.awt.*;
import javax.swing.*;
class scroll
{
public static void main(String[] args)
{
Frame f = new Frame ("Demo");
JPanel p = new JPanel();
JButton b1 = new JButton("Button 1");
JButton b2 = new JButton("Button 2");
p.setBackground(Color.red);
p.add(b1);
p.add(b2);
JScrollPane s = new JScrollPane(p);
f.add(s);
f.setSize(70,70);
f.setVisible(true);
}
} 

Thanks

Ads









Related Tutorials/Questions & Answers:
Scroll in JPanel
Scroll in JPanel  Hello sir,  Hi Friend, You can use the following code: import java.awt.*; import javax.swing.*; class scroll { public static void main(String[] args) { Frame f = new Frame ("Demo"); JPanel p = new
jpanel
jpanel  hello sir, i made one jpanel inside the frame and made the button inside the panel.. wrote the only second panel code other class file.. so when click the button then open the second panel same place of first panel
Advertisements
jpanel
jpanel  hello sir, i made one jpanel inside the frame and made the button inside the panel.. wrote the only second panel code other class file.. so when click the button then open the second panel same place of first panel
jpanel
jpanel  hello sir, i made one jpanel inside the frame and made the button inside the panel.. wrote the only second panel code other class file.. so when click the button then open the second panel same place of first panel
jpanel
jpanel  hello sir, i made one jpanel inside the frame and made the button inside the panel.. wrote the only second panel code other class file.. so when click the button then open the second panel same place of first panel
Press button and Scroll Image to Scrollpanel
Press button and Scroll Image to Scrollpanel  Insert image into the jpanel,inside the jscrollpane.If i press the button and scroll image
Jpanel allignment
Jpanel allignment  i have two panels added one below anotehr. and i have a one button. when i clicked button. the first panel ara should be overlapped with second panel. i mean second panel size should cover both paenls size
Scroll ImagesUIScrollView
Scroll ImagesUIScrollView  Hi, Can anyone please suggest me how to scroll images in UIScrollView in iPad? THanks
How to add JTable in JPanel
How to add JTable in JPanel  How to add JTable in JPanel
ModuleNotFoundError: No module named 'Scroll'
ModuleNotFoundError: No module named 'Scroll'  Hi, My Python... 'Scroll' How to remove the ModuleNotFoundError: No module named 'Scroll'... to install padas library. You can install Scroll python with following command
javascript set scroll height
javascript set scroll height  How to set scroll height in JavaScript?   CSS Scroll Method div { width:150px; height:150px; overflow:scroll; } JavaScript ScrollTo method <script type="text/javascript">
Draw bufferimage in jpanel using netbeans
Draw bufferimage in jpanel using netbeans  please i need urgent help. i have form which contains some fields generated in netbeans. how can i draw bufferimage in Jpanel that is inside the form. thanks
Horizontal scroll bar?
Horizontal scroll bar?  Hi all, I have a HTTP Servlet... this. While the browser window automatically creates a vertical scroll bar, it does not automatically create a horizontal scroll bar when the data written exceeds
Draw a line in a JPanel with button click in Java
Draw a line in a JPanel with button click in Java  Draw a line in a JPanel with button click in Java
How to draw in jPanel? swing/graphics Java
How to draw in jPanel? swing/graphics Java  How to draw in jPanel? (swing/graphics Java
ModuleNotFoundError: No module named 'js.angular_scroll'
ModuleNotFoundError: No module named 'js.angular_scroll'  Hi, My... named 'js.angular_scroll' How to remove the ModuleNotFoundError: No module named 'js.angular_scroll' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'marquee-scroll'
ModuleNotFoundError: No module named 'marquee-scroll'  Hi, My... named 'marquee-scroll' How to remove the ModuleNotFoundError: No module named 'marquee-scroll' error? Thanks   Hi, In your python
JTABLE SCROLL PANE
JTABLE SCROLL PANE  The scrollpane for a image in Jtable is only showing but not working ....here is the code i am doing please suggest something... import java.awt.Component; import java.io.FileReader; import
JTABLE SCROLL PANE
JTABLE SCROLL PANE  The scrollpane for a image in Jtable is only showing but not working ....here is the code i am doing please suggest something... import java.awt.Component; import java.io.FileReader; import
Create a Scroll Pane Container in Java
Create a Scroll Pane Container in Java   ... to create a scroll pane container in Java Swing. When you simply create a Text Area... for the result of the given program: This program shows a scroll pane
Display Multiple Images in jscrollpane using Java Jpanel
Display Multiple Images in jscrollpane using Java Jpanel  Browse and Display multiple images in vertical view of java jscrollpane using jpanel
ModuleNotFoundError: No module named 'dash_scroll_up'
ModuleNotFoundError: No module named 'dash_scroll_up'  Hi, My... named 'dash_scroll_up' How to remove the ModuleNotFoundError: No module named 'dash_scroll_up' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'dash_scroll_up'
ModuleNotFoundError: No module named 'dash_scroll_up'  Hi, My... named 'dash_scroll_up' How to remove the ModuleNotFoundError: No module named 'dash_scroll_up' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'dash_scroll_up'
ModuleNotFoundError: No module named 'dash_scroll_up'  Hi, My... named 'dash_scroll_up' How to remove the ModuleNotFoundError: No module named 'dash_scroll_up' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'djangocms-animate-on-scroll'
ModuleNotFoundError: No module named 'djangocms-animate-on-scroll'  ...: No module named 'djangocms-animate-on-scroll' How to remove the ModuleNotFoundError: No module named 'djangocms-animate-on-scroll' error? Thanks
ModuleNotFoundError: No module named 'django-infinite-scroll-pagination'
ModuleNotFoundError: No module named 'django-infinite-scroll-pagination' ...: ModuleNotFoundError: No module named 'django-infinite-scroll-pagination' How to remove the ModuleNotFoundError: No module named 'django-infinite-scroll-pagination'
ModuleNotFoundError: No module named 'django-sublime-scroll'
ModuleNotFoundError: No module named 'django-sublime-scroll'  Hi...: No module named 'django-sublime-scroll' How to remove the ModuleNotFoundError: No module named 'django-sublime-scroll' error? Thanks   Hi
ModuleNotFoundError: No module named 'js.angular_ui_scroll'
ModuleNotFoundError: No module named 'js.angular_ui_scroll'  Hi...: No module named 'js.angular_ui_scroll' How to remove the ModuleNotFoundError: No module named 'js.angular_ui_scroll' error? Thanks   Hi
ModuleNotFoundError: No module named 'js.angular_infinite_scroll'
ModuleNotFoundError: No module named 'js.angular_infinite_scroll'  Hi...: No module named 'js.angular_infinite_scroll' How to remove the ModuleNotFoundError: No module named 'js.angular_infinite_scroll' error? Thanks
ModuleNotFoundError: No module named 'js.angular_ui_scroll'
ModuleNotFoundError: No module named 'js.angular_ui_scroll'  Hi...: No module named 'js.angular_ui_scroll' How to remove the ModuleNotFoundError: No module named 'js.angular_ui_scroll' error? Thanks   Hi
ModuleNotFoundError: No module named 'js.jquery_infinite_ajax_scroll'
ModuleNotFoundError: No module named 'js.jquery_infinite_ajax_scroll' ...: No module named 'js.jquery_infinite_ajax_scroll' How to remove the ModuleNotFoundError: No module named 'js.jquery_infinite_ajax_scroll' error

Ads