Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Swing-AWT Scroll in JPanel
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


FaizalArafath
Scroll in JPanel
1 Answer(s)      4 years ago
Posted in : Swing AWT


Hello sir,

Advertisement
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



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
Displaying the same image in a JPanel and using scroll - HELP - Java Beginners
Displaying the same image in a JPanel and using scroll - HELP  I hope someone can help me out here. I want to display an image in a JPanel which... the scroll pane. */ public class DrawingPane extends JPanel
Advertisements
scrollbar in JPanel
scrollbar in JPanel  Scroll bar is not working when i am using...*;import javax.swing.*;class scroll {public static void main(String[] args){Frame f = new Frame ("Demo");JPanel p = new JPanel();JButton b1 = new
Scroll ImagesUIScrollView
Scroll ImagesUIScrollView  Hi, Can anyone please suggest me how to scroll images in UIScrollView in iPad? THanks
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
How to add JTable in JPanel
How to add JTable in JPanel  How to add JTable in JPanel
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">
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
Regarding Scroll Bar - CVS
Regarding Scroll Bar  HI all, i have a Text Message box which i have incorporated in my code which goes something like
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
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
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
Java scroll pane-java GUI
Java scroll pane-java GUI  Dear friends.. Very Good morning. I have a doubt in my gui application. Take ex:- My gui application has 1 Jscrollpane of height 600 and width 400. normally it is showing 200 height and 400 width
How to draw in jPanel? swing/graphics Java
How to draw in jPanel? swing/graphics Java  How to draw in jPanel? (swing/graphics Java
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 save JPanel as gif or jpeg file
How to save JPanel as gif or jpeg file  i draw polygons , rectangles, lines on jpanel using draw line method drawpolygon methods etc, now i want save the data of jpanel which is drawn by me(lines,polygons) as a gif or jpeg file
how to scroll multiple images using on Click in Android
how to scroll multiple images using on Click in Android  I am new android platform, now i am working with small application. here... to scroll multiple images. But i am able to scroll single image. plz let me know
scroll bars to list box - JSP-Servlet
scroll bars to list box  Can I add scroll bars to a list box in struts?  Hi friend, Scroll the list box in struts Two attribute set "multiple" "size". Select Tag Example Select Tag
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
Display message on scroll Event
Display message on scroll Event In this tutorial, we will discuss about how to display message on scrolling of text area using jQuery scroll event. In this example, a text area with scroll bars are given , when we scroll any one
resize image with the change in size of jpanel.. - Java Beginners
resize image with the change in size of jpanel..  hi.. i am try to insert image in jpanel in jform to give attractive look to application,but the of image do not changes if the size of jframe or jpanel changes. if there is any
The scroll browser event of jQuery
The scroll browser event of jQuery In this tutorial ,we will print message on browser's window scrolling using scroll browser event of jQuery. In this example, some paragraphs are written , when we scroll down, a message
How to save JPanel as gif or jpeg file
How to save JPanel as gif or jpeg file  i draw polygons , rectangles, lines on jpanel using draw line method drawpolygon methods etc, now i want save the data of jpanel which is drawn by me(lines,polygons) as a gif or jpeg file
How to Add JComboBox on JPanel - Java Beginners
How to Add JComboBox on JPanel  How to Add JComboBox on JPanel D:\java>javac ViewElements.java ViewElements.java:181: expected jc.addItem("France"); ^ ViewElements.java:182: expected
Scrollpane in Java Swing
will study how to scroll the drawing on canvas. For this, we have used class Canvas which extends the class JPanel. The method setSize() resizes the component
How to Set Transperent Background Image to Jpanel - Java Beginners
How to Set Transperent Background Image to Jpanel  Sir ,How to set Background Image to Jpanel.  Hi Friend, Try the following code: import java.awt.*; import java.awt.event.*; import javax.swing.*; public
Create Scroll Bar in Java using SWT
Create Scroll Bar in Java using SWT       This section is all about creating scroll bar in Java SWT  The given example will show you how to create scroll bar in Java using
Show the Value of Scroll Bar in Java Swing
Show the Value of Scroll Bar in Java Swing   ... the value of scrolling position in the text box. The scroll bar has multiples... and scrollbar bottom arrow. When you scroll the scrollbar with the help
JDBC ResultSet Scroll Sensitive Type Example
JDBC ResultSet Scroll Sensitive Type Example: Through this ResultSet type... the statement object to create a Scroll-Sensitive, read only ResultSet object. Statement stmt = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE
Advertisements
 

 

 

DMCA.com