BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 07-28-2009, 10:08 AM   #1 (permalink)
New Member
 
Join Date: Jul 2009
Model: 7100T
PIN: N/A
Carrier: Perl
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Post how to Scroll only a part of screen......

Please Login to Remove!

Hi,

I am developing a BlackBerry Application in JDE. I have developed a screen in which the Top most part is the heading, and below that i have lot of contents which have to be scrolled. The problem i am facing is when i scroll my content even the heading gets scrolled where as i need it to be static or should not be scrolled only the contents should be scrolled.

I have extended Screen and called

super( new VerticalFieldManager(VerticalFieldManager.VERTICAL _SCROLL|VerticalFieldManager.VERTICAL_SCROLLBAR) );
Offline  
Old 08-21-2009, 02:28 AM   #2 (permalink)
New Member
 
Join Date: Jul 2009
Model: 7100T
PIN: N/A
Carrier: Perl
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

The following code will scroll a pagw with huge data you also add a Button in the end and you own fields.........



Code:

package scroll.pk;

import net.rim.device.api.ui.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.ui.container.VerticalFieldManager.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.system.*;


public class Scroll extends Screen
{
   
   Bitmap img;
      
   public Scroll() 
   {    
   
        super(new VerticalFieldManager(),NO_VERTICAL_SCROLL);
        img = Bitmap.getBitmapResource("img/backgroung.png");
        
        HorizontalFieldManager title = new HorizontalFieldManager(HorizontalFieldManager.FIELD_HCENTER);
        LabelField tit = new LabelField("BioData");
        title.add(tit);
        add(title);
     
        HorizontalFieldManager title2 = new HorizontalFieldManager(HorizontalFieldManager.FIELD_HCENTER);
        LabelField tit2 = new LabelField("ABCD");
        title2.add(tit2);
        add(title2);
        
        HorizontalFieldManager titlebtn = new HorizontalFieldManager(HorizontalFieldManager.FIELD_HCENTER);
        ButtonField StartBtn = new ButtonField("FirstButton");
        titlebtn.add(StartBtn);
        add(titlebtn);
     

       VerticalFieldManager data = new VerticalFieldManager(VerticalFieldManager.VERTICAL_SCROLL | VerticalFieldManager.VERTICAL_SCROLLBAR | Field.USE_ALL_WIDTH);

           
                
        
        HorizontalFieldManager page1 = new HorizontalFieldManager();
        LabelField d_name1 = new LabelField("Name1:",LabelField.FIELD_RIGHT);
        page1.add(d_name1);
        data.add(page1);
        
        HorizontalFieldManager page2 = new HorizontalFieldManager();
        LabelField d_name2 = new LabelField("Name2:",LabelField.FIELD_RIGHT);
        page2.add(d_name2);
        data.add(page2);
        
        
        HorizontalFieldManager page3 = new HorizontalFieldManager();
        LabelField d_name3 = new LabelField("Name3:",LabelField.FIELD_RIGHT);
        page3.add(d_name3);
        data.add(page3);
        
        
        HorizontalFieldManager page4 = new HorizontalFieldManager();
        LabelField d_name4 = new LabelField("Name4:",LabelField.FIELD_RIGHT);
        page4.add(d_name4);
        data.add(page4);
        
        HorizontalFieldManager page5 = new HorizontalFieldManager();
        LabelField d_name5 = new LabelField("Name5:",LabelField.FIELD_RIGHT);
        page5.add(d_name5);
        data.add(page5);
        
        HorizontalFieldManager page6 = new HorizontalFieldManager();
        LabelField d_name6 = new LabelField("Name6:",LabelField.FIELD_RIGHT);
        page6.add(d_name6);
        data.add(page6);
        
        HorizontalFieldManager page7 = new HorizontalFieldManager();
        LabelField d_name7 = new LabelField("Name7:",LabelField.FIELD_RIGHT);
        page7.add(d_name7);
        data.add(page7);
        
        HorizontalFieldManager page8 =  new HorizontalFieldManager();
        LabelField d_name8 = new LabelField("Name8:",LabelField.FIELD_RIGHT);
        page8.add(d_name8);
        data.add(page8);
        
        HorizontalFieldManager page9 = new HorizontalFieldManager();
        LabelField d_name9 = new LabelField("Name9:",LabelField.FIELD_RIGHT);
        page9.add(d_name9);
        data.add(page9);
        
        HorizontalFieldManager page10 = new HorizontalFieldManager();
        LabelField d_name10 = new LabelField("Name10:",LabelField.FIELD_RIGHT);
        page10.add(d_name10);
        data.add(page10);
        
        HorizontalFieldManager page11 =  new HorizontalFieldManager();
        LabelField d_name11 = new LabelField("Name:11",LabelField.FIELD_RIGHT);
        page11.add(d_name11);
        data.add(page11);
        
        HorizontalFieldManager page12 =  new HorizontalFieldManager();
        LabelField d_name12 = new LabelField("Name:12",LabelField.FIELD_RIGHT);
        page12.add(d_name12);
        data.add(page12);
        
        HorizontalFieldManager page13 =  new HorizontalFieldManager();
        LabelField d_name13 = new LabelField("Name:13",LabelField.FIELD_RIGHT);
        page13.add(d_name13);
        data.add(page13);
        
        HorizontalFieldManager page14 =  new HorizontalFieldManager();
        LabelField d_name14 = new LabelField("Name:14",LabelField.FIELD_RIGHT);
        page14.add(d_name14);
        data.add(page14);
        
        NullField nullField = new NullField(Field.FOCUSABLE);
        data.add(nullField);
        add(data);

        
    }        
                
        
    public void paintBackground(Graphics graphics)
    { 
        graphics.clear();
        graphics.drawBitmap(0, 0, Display.getWidth(), Display.getHeight(),img, 0, 0);                       
        super.paint(graphics);
    } 
    
    protected void sublayout( int width, int height )
    {
        setExtent(width,height );
        setPosition( 0,0 );
        layoutDelegate(width,height );
    } 
   
   
   
}
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Woods 59008 Decora Style 60-30-20-10 Minute Preset Wall Switch Timer, White,
$26.82
 Woods 59008 Decora Style 60-30-20-10 Minute Preset Wall Switch Timer, White, pictureHUBBELL CIRCUIT LOCK HBLDS3 DISCONNECT SWITCH * NEW IN BOX *
$159.0
HUBBELL CIRCUIT LOCK HBLDS3 DISCONNECT SWITCH * NEW IN BOX * picture14 available at MostElectric: 800E3D0 800E-3D0 ALLEN BRADLEY NEW
$22.0
14 available at MostElectric: 800E3D0 800E-3D0 ALLEN BRADLEY NEW picture ALLEN BRADLEY 440N-Z21SS2BN9 SensaGuard Non-Contact Switch 
$27.13
 ALLEN BRADLEY 440N-Z21SS2BN9 SensaGuard Non-Contact Switch  pictureLeviton DZ15S-1RZ Decora Z-Wave 15-Amp Switch White/ Light Almond
$34.99
Leviton DZ15S-1RZ Decora Z-Wave 15-Amp Switch White/ Light Almond picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.