JScroll Bar Problem

JScroll Bar Problem

Hello sir , Can't we add JScrollBar directly to JFrame only by adding some buttons so that we can scroll and see these buttons... please provide me simple example but without adding JPanel to to JFrame...

View Answers

July 1, 2011 at 3:23 PM

import java.awt.*;
import javax.swing.*;

public class AddScrollBarToJFrame {
  public static void main(String args[]) {
    JScrollBar bar1 = new JScrollBar(JScrollBar.HORIZONTAL);
    JScrollBar bar2 = new JScrollBar(JScrollBar.VERTICAL);
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container contentPane = frame.getContentPane();
    contentPane.add(bar1, BorderLayout.SOUTH);
    contentPane.add(bar2, BorderLayout.EAST);
    frame.setSize(300, 150);
    frame.setVisible(true);
  }
}

Ads









Related Tutorials/Questions & Answers:
JScroll Bar Problem
JScroll Bar Problem  Hello sir , Can't we add JScrollBar directly to JFrame only by adding some buttons so that we can scroll and see these buttons... please provide me simple example but without adding JPanel to to JFrame
ModuleNotFoundError: No module named 'django-jscroll'
ModuleNotFoundError: No module named 'django-jscroll'  Hi, My... named 'django-jscroll' How to remove the ModuleNotFoundError: No module named 'django-jscroll' error? Thanks   Hi, In your python
Advertisements
java gui-with jscroll pane
java gui-with jscroll pane  Dear friends.. I have a doubt in my gui application. I developed 1 application. In this application is 1 Jscrollpane of height 600 and width 400. Normally it is showing 200 height and 400 width
java gui-with jscroll pane
java gui-with jscroll pane  Dear friends.. I have a doubt in my gui application. I developed 1 application. In this application is 1 Jscrollpane of height 600 and width 400. Normally it is showing 200 height and 400 width
Bar graph
Bar graph  How to include a bar chart in iPhone sdk
bar chart
bar chart  how to create a bar chart from values of the database and the string value should be the entities of the database??plzz help..needed badly
Bar Chart
Bar Chart  hi...... Thanks 4 ur help for the bar graph creation i have got what i wanted. But now want to ask that in that bar graph i want multiple bar on one value means I want to create a graph where on my x-axis i have
Progress Bar
Progress Bar  Hi friend, I'm interested in knowing how to progress bar in oracle forms 9i for the trigger when-button-pressed.Thankyou. Thanks and Regards, M.SHANKAR
progress bar
progress bar  Hi guys, I'm doing a file upload in spring MVC technology. For file upload i did validation in client side.While uploading how to use an ajax function to show the progress bar
struts collection problem in Mozilla
struts collection problem in Mozilla   I used the to get list of records, if records are more than 15-20 then this is not seen properly with vertical scroll bar on Mozilla. Plz help me
Bar chart implementation in PHP
Bar chart implementation in PHP  How to implements reports in bar graphs by using PHP
ModuleNotFoundError: No module named 'bar'
ModuleNotFoundError: No module named 'bar'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'bar' How to remove the ModuleNotFoundError: No module named 'bar' error
Removing the Title Bar of a JFrame
Removing the Title Bar of a JFrame  How to remove the Title Bar of a JFrame in Swing Application?   Please check the tutorial Removing the Title Bar of a Frame for the source code and example description. Thanks
Bar charts and jsp
Bar charts and jsp  Hi, How to generate Dynamic Bar Chart Images using jsp with placing any image location in weebroots? Thanks in advance
problem in onlinetest...
problem in onlinetest...  hi, my code getting the problem is ,when user leave a question then the server puts error... pls help me
custom navigation bar in iphone
custom navigation bar in iphone  How can i create a custom navigation bar in iPhone application? I wanted to add UIBarButton items as well as Search bar on the UINavigation controller ... please tell me if i need to create
UINavigationController hide navigation bar
UINavigationController hide navigation bar  HI, How to hide the navigation bar of UINavigationController? I have to hide navigation bar... code for hiding UINavigationController's navigation bar
datewise/monthwise bar graph
datewise/monthwise bar graph  How to make a datewise/monthwise bar graph using the values from the ms access database? please help its urgent
Stacked Bar Chart
Stacked Bar Chart  How to display a stacked bar chart using java from the values stored in the ms access database?Plzz help..its urgent
Iphone Tab Bar Controller
Iphone Tab Bar Controller  Hi, I am very new in mobile application programming. So, how can i create iphone tab bar controller apps. Please suggest me any online help, so that i will enhance my technical skill in mobile web
java bar charts and jsp
java bar charts and jsp  Hi, Can any one help me out in how to create java bar charts using jsp with the help of data base table values? thanks in advance   Have a look at the given link: http://www.roseindia.net
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
Menu Bar prob.
Menu Bar prob.  I want a menu to be displayed in each page of my swing appl. how to go abt
javascript problem
javascript problem  hi guys My problem is that I am using radio button for yes or no but i want to do that if I press yes button then enter... enter please help me this problem
problem on strings
problem on strings  in string1 "123456 ABC DEF...",IN string2 "raveen". iwant to add string2 after 123456 in the first string based on index number.i need logic for this with out using StringBuffer concept. Thanks in advanace
Problem with loginbean.jsp
Problem with loginbean.jsp  http://www.roseindia.net/jsp/loginbean.shtml - I am getting an error in loginbean.jsp.There is some error regarding .What is hello in this? Also in this example how
compilation problem
compilation problem  struts 2.0 : i have included all 5 jars in lib folder,but its giving compilation problem that package open symphony doesnot... havenot set the build path.if this is the problem then tell me how to set
compilation problem
compilation problem  struts 2.0 : i have included all 5 jars in lib folder,but its giving compilation problem that package open symphony doesnot... havenot set the build path.if this is the problem then tell me how to set
Problem with cookies
Problem with cookies  Hello All, i need jsp code for RememberMe module of login. i am facing problem with cookies. so please if any one could guide me please help and provide mme the exact code.   Please visit
problem with package
problem with package  Dear sir, i have created one java file with package com.net; and i compiled the program.it showing the .class file in " net" folder.The problem is i want to use that .class file in some other
Create Bar graph
Create Bar graph  hi............. In my project i want to create a BAR GRAPH to display the result. I HAVE certain values that want to show in graph form. Can u help me plzzzzzzz i require a very simple code in java swings were

Ads