How can I create JScrollPane in my swing application with scroll bars movin

Hi,
How can we create scrollpanes moving with scrollbars.I tried many times with custom layout.but it does not work if i set custom layout.I hope that I will get my problem solved.
Thanks and Regards,
Rameh RK

This means it is not possible to create a pure unicode file without the byte order mark?
You wouldn't happen to know how a file with byte order mark should read on a Linux system?
Or if this possible or not?
Regards
Christian

Similar Messages

  • How can I create a shortcut to my application?

    Hello
    I have just created my first application, and I would like to start it from a shortcut in my winXP desktop. But how can I since it is not an .exe file? I am using the NetBeans IDE 3.5.1 that comes with the java bundle, and I have tried unsuccsessfully to find some solution there. I have also scanned both of my Java books (for beginners...:) without luck. I appreciate any help you can provide.
    Jens

    hi,
    just download FreeJava or JCreator and save ur application as a project and then convert that project to an executable jar file. make a shortcut to this executable .jar file which will start ur project from the desktop.

  • How can I create an adaptable full-width site with sliding parallax panel?

    Hi guys!
    I have to create a web site with a full-width resolution, adaptable with any monitor and resolution using some panels that moves using the parallax scroll-motion with a sliding effects.
    For example I nedd a site like "collecdiv.com" that works with the same effects and with an adaptable full-widht size page.
    Here's some screen I take of my site with a 22" 1920x1080 resolution and a 15" 1280x1024.
    The 4 tab I want to see in full width and in scroll motion parallax: four with a resolution of 22" and the other four with a resolution of 15" (the screen are made with paint to let you see what is the problem)
    In the first tab there's a slideshow widget with some photo, in the other tabs there's a rectangular form with an image fill... I have to see the same layout that I see in my 22" monitor, in other smaller or bigger monitor (like 15") just like in the "collecdiv.com" website... The Dimension of my muse file is 960px width
    How can i resolve the problem? How can I fix the screen so anyone else can see my site without problem and with all the resolution?
    Who can help me? PLEASE
    Thanks in advice
    Francesco
    P.S.: an advise... check the site "www.collecdiv.com" to see what I nedd

    I'm adding this screenshot so you can understand the problem... The 4 tab I want to see in full width and in scroll motion parallax: four with a resolution of 22" and the other four with a resolution of 15" (the screen are made with paint to let you see what is the problem)
    In the first tab there's a slideshow widget with some photo, in the other tabs there's a rectangular form with an image fill... I have to see the same layout that I see in my 22" monitor, in other smaller or bigger monitor (like 15") just like in the "collecdiv.com" website... The Dimension of my muse file is 960px width
    Pleas help me

  • How can I create a new excel workbook only with labview

    Hi everyone...
    I'm trying to create a new excel workbook only with labview but I can't find the file in the hard disk.
    Someone knows?
    Labview 8,0
    Attachments:
    Create new WB with LV.vi ‏18 KB

    You are not using the correct mechanism. Pull up the Example Finder in LabVIEW, click on the "Search" tab, and enter "Excel". Look for an example called "Write Table to XL". Use this as a starting point for creating new workbooks and adding data to it.
    Note: on disk the example is at <LabVIEW install directory>\examples\comm\ExcelExamples.llb.
    Message Edited by smercurio_fc on 06-05-2007 11:08 AM

  • How can I create a portal server authentication user with a batch

    hi,
    I am trying to import users into the portal server emulating the create user procedure as plumtree. What I cannot understand at the moment is which classes are involved in the sequence of creating a user.
    the problem starts from the fact that I have used a synch WS and it works but, being the table a dummy one and the users to be authenticated by the portal server, I couldn't use that synch as a definitive.
    I tryed using plumtree.server.CIPTUser class with no success. could not understand how to actually create the user after setting the parameters to the object.
    Is there any documentation explaining how to create the portal server emulation of create user. this could be usefull for all those cases when there is no central repository of user and passwords.
    thanks
    Mario

    This should get you started.
    IPTUser=IPTSession.GetUsers.Create(iAdminFolderID)
    IPTServerContext=IPTUser.GetInterFaces("IPTServerContext")
    IPTServercontext.Store
    This is a high level implementation. It should get you very close.
    thanks,
    Craig

  • How can i create Database Connection in Swing Applet?

    A DESCRIPTION OF THE PROBLEM :
    I am unable to connect to oracle database using thin driver
    in Swing Applet.
    ENVIRONMENT:
    java version "1.3.1_02"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_02-b02)
    Java HotSpot(TM) Client VM (build 1.3.1_02-b02, mixed mode)
    FULL OPERATING SYSTEM VERSION : NT 4.0
    Java file:-
    import javax.swing.*;
    import java.awt.event.*;
    import java.sql.*;
    import java.awt.*;
    public class SwingApplet extends JApplet
       public void init(){
       public void start(){
        JTextField txf=new JTextField();
        JButton btn=new JButton("Click Me");
        btn.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent ae){
            try{
            DriverManager.registerDriver(new
    oracle.jdbc.driver.OracleDriver());
            Connection con=DriverManager.getConnection
    ("jdbc:oracle:thin:@orasrv:1521:oracledb","hrisadmin","hrisadmin");
            Statement st=con.createStatement();
            ResultSet rs=st.executeQuery("select * from applicant");
            }catch(Exception e){JOptionPane.showMessageDialog
    (null,e.toString());}
            JOptionPane.showMessageDialog(null,"Hai Swing is cool");
        getContentPane().add(txf,BorderLayout.NORTH);
        getContentPane().add(btn,BorderLayout.CENTER);
       public void stop(){
       public void destroy(){
    html file:-
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
       width="120" height="160" align="middle"
       codebase="http://java.sun.com/products/plugin/1.1.2/
            jinstall-12-win32.cab#Version=1,2,0,0">
       <PARAM NAME="code" VALUE="SwingApplet.class">
       <PARAM NAME="codebase" VALUE=".">
       <PARAM NAME="archive" VALUE="classes111.zip">
    </OBJECT>ERROR MESSAGES/STACK TRACES THAT OCCUR :
    java.security.AccessControlException:access denied(java.net.SocketPermission or
    asrv resolve)

    if the applet runs locally, and you want to connect to your DB locally with the applet, it won't work (except if you adjust the security settings of your browser, maybe). That's because applets don't have access to the computer they're running on (except some information), since that would mean that any applet could just access your computer, so, it's not possible for security purposes.
    On the other hand, they don't have to right to connect to anything, except the server they're downloaded from ( so the webserver's ip).
    But I'm not sure about connecting to a DB through JDBC that way.
    Tom

  • How can I create a group of 5x3 buttons with a drop down meny that will slide down the 5 boxes beneath in Muse?

    I am making a porfoliosite in Muse, and want to show 5 x 3 thumbnails of my work that you can click on to see more of the same work. When you click I want a drop down box that will slide down the boxes beneath. Like on this page: http://rajoon.com/. Anyone that know how?

    Have you considered using CSS styled text/list menus instead of image rollovers.  It isn't hard really and it's actually a much better choice for   web accessibility and for search engines to find and follow your links.   Here are some links to several CSS menu systems you can try:
    CSS Express Drop-Down Menus (tutorial)
    http://www.projectseven.com/tutorials/navigation/auto_hide/
    CSS Tab Designer creates 60+ CSS Styled Button and Tab Menus  (download)
    http://www.highdots.com/css-tab-designer/
    List-O-Rama  (DW Extension)
    http://www.dmxzone.com/go?5618
    CSS  Menu Maker (On-Line Menu Generator)
    http://www.cssmenumaker.com/
    Pop-Menu  Magic2 by PVII (DW extension purchase)
    http://www.projectseven.com/products/menusystems/pmm2/index.htm
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • How can I create a new game enter account with the same iTunes account

    I Created a separate gamec enter account for my two sons, I'd like to create one for my wife but I can't find a way to do it under ios8 can somebody help? Thanks

    Go to the System Preferences>Users.
    Click the lock if and enter your password, if necessary.
    Then click on the "+" symbol below the accounts list.
    From the "New Account" menu, select"Administrator" and fill in the rest of the information.
    And finally click the "Create Account" button.
    Done. A new Administrator user account.

  • How can I Create custom pop up dialog box with question/answer

    I need to create a pop up dialog box that asks a question and accepts an answer input.  The form needs to be able to be emailed out (not server based)  Can someone help me do this?  I am a designer,  with very (Very!) limited coding skills.   Looks like the windjack program that I keep running into does not work with Acrobat X.
    Thanks for any help you may have

    I am not able to help you with the current method you are using - which seems an odd one in that you are using a menu script to do this????
    I would have done the page completely differently - instead of slicing it up into a vastly complex table, I'd have added the image to the page and then used an imagemap.  Then I'd have used this script to add the popups (as toolitps) that you can be as simple or as complex as you wish: http://boxover.swazz.org/.
    E. Michael Brandt
    www.divahtml.com
    www.divahtml.com/products/scripts_dreamweaver_extensions.php
    Standards-compliant scripts and Dreamweaver Extensions
    www.valleywebdesigns.com/vwd_Vdw.asp
    JustSo PictureWindow
    JustSo PhotoAlbum, et alia

  • How can I create a Lion USB Thumb Drive with the 11E2068 build?

    It seems that the Lion build from the Mac App Store is not compatible with my Macbook Pro Retina 15''. It's seems I would need the the build 11E2068 for my USB thumb drive to work properly.
    I don't want to go through the internet recovery and loose 8 hours.
    Is there anyway for my to get that build(11E2068) on my USB thumb drive?
    Thanks,

    keg55's given you article that allows you to capture the installer. These are the critical portions:
    Once that data has been downloaded, Lion Recovery restarts your Mac, immediately installs the OS, and then deletes the installer data. The trick is to interrupt that process—safely—so you can grab the installer data and keep it. Here are the steps to take:
    IMO, Apple needs to rethink this process. Unless users with machines that had Lion preinstalled, like yourself, let Apple know this process is terrible, they'll not change their minds.
    7.  IMPORTANT: Monitor the download’s progress. As the progress bar gets near the end, get ready, because once the status reads About 0 seconds remaining, the progress bar will disappear, the installer will spend a minute or two cleaning up, and then your Mac will restart. As soon as the screen goes dark, unplug your external drive. If you wait too long, your Mac will boot into the Mac OS X installer on that drive, starting the installation process. Interrupting that process can leave your Mac unable to install OS X unless you restart it and—I’m not joking—zap PRAM.

  • Divide JscrollPane into 2 picure viewer with scroll bar

    Hello to all, help me, i must divide a JScrollPane into 2 sub-windows in witch putting 2 different images.
    The image that i put at left is loaded by a JFileChooser.
    This is the code, my problem is into load_file() function.
    Help me, thanks a lot.
    Escuse me for my bad english.
    package Crypto;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.applet.*;
    import java.net.*;
    import javax.imageio.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.io.File.*;
    import javax.swing.filechooser.FileFilter;
    import java.io.*;
    public class Crypto extends JFrame implements ActionListener {
    private BufferedImage sorgente = null;
    private BufferedImage shares = null;
    private BufferedImage somma = null;
    private JMenuBar mb;
    private JMenu menu1;
    private JMenu menu2;
    private JMenu menu3;
    private JButton go;
    private JButton set_n;
    private JButton set_k;
    private JButton op;
    private JButton schemi;
    private JMenuItem item_01;
    private JMenuItem item_02;
    private JMenuItem item_03;
    private JMenu item_04;
    private JMenuItem item_04_a;
    private JMenuItem item_04_b;
    private JMenuItem item_05;
    private JMenuItem item_06;
    private JMenuItem item_07;
    private JMenuItem item_08;
    private BorderLayout layout = new BorderLayout();
    private JToolBar tb = new JToolBar();
    private int k = 2;
    private int n = 4;
    private String formato = "PNG";
    private File original;
    private File sovra_imp;
    private Schema curr;
    private ImageIcon ii = new ImageIcon();
    private JScrollPane JSPanel;
    private ScrollablePicture picture;
    public Crypto() {
    this.getContentPane().setLayout(layout);
    this.getContentPane().add(BorderLayout.NORTH,tb);
    JSPanel = new JScrollPane();
    //JSPanel.setSize(150, 250);
    this.getContentPane().add(BorderLayout.WEST, JSPanel);
    mb = new JMenuBar();
    mb.setAutoscrolls(true);
    setJMenuBar(mb);
    menu1= new JMenu("File");
    mb.add(menu1);
    item_01 = new JMenuItem("Apri file ...");
    menu1.add(item_01);
    item_02 = new JMenuItem("Quit ...");
    menu1.add(item_02);
    menu2= new JMenu("Impostazioni");
    mb.add(menu2);
    item_03 = new JMenuItem("Formato salvataggio shares");
    menu2.add(item_03);
    item_05 = new JMenuItem("Modifica numero partecipanti");
    menu2.add(item_05);
    item_06 = new JMenuItem("Imposta grado di visibilit�");
    menu2.add(item_06);
    item_04 = new JMenu("Schemi");
    item_04_a = new JMenuItem ("Schema corrente");
    item_04.add (item_04_a);
    item_04_b = new JMenuItem("Modifica schema corrente");
    item_04.add (item_04_b);
    menu2.add(item_04);
    menu3= new JMenu("Help");
    mb.add(menu3);
    item_07 = new JMenuItem("Guida");
    menu3.add(item_07);
    item_08 = new JMenuItem("About");
    menu3.add(item_08);
    op = new JButton ("Apri file ");
    op.addActionListener(this);
    tb.add(op);
    go = new JButton("Crea shares");
    go.addActionListener(this);
    tb.add(go);
    set_k = new JButton("Modifica visibilit� shares");
    set_k.addActionListener(this);
    tb.add(set_k);
    set_n = new JButton("Modifica n. partecipanti");
    set_n.addActionListener(this);
    tb.add(set_n);
    schemi = new JButton("Modifica schema corrente");
    schemi.addActionListener(this);
    tb.add(schemi);
    item_01.addActionListener(this);
    item_02.addActionListener(this);
    item_03.addActionListener(this);
    item_04_a.addActionListener(this);
    item_04_b.addActionListener(this);
    item_05.addActionListener(this);
    item_06.addActionListener(this);
    item_07.addActionListener(this);
    item_08.addActionListener(this);
    curr = Schema.carica_schema ("2-2-b-w");
    this.setBounds(150, 150, 800, 500);
    this.setDefaultCloseOperation(EXIT_ON_CLOSE);
    this.setTitle("Crypto magic");
    this.setVisible(true);
    public void actionPerformed(java.awt.event.ActionEvent ae) {
    Object source = ae.getSource();
    Class sourceClass = source.getClass();
    if (sourceClass.getName().equals("javax.swing.JMenuItem")){
         JMenuItem ch = (JMenuItem) source;
    if (ch == item_01){
    load_file();
    }else if (ch == item_02){
    close_frame();
    }else if (ch ==item_03){
    scegli_formato();
    }else if (ch == item_04_a){
    schema_corrente();
    }else if (ch == item_04_b){
    cambia_schema();
    }else if (ch == item_05){
    set_n();
    }else if (ch == item_06){
    set_k();
    }else if (ch == item_07){
    guida();
    }else about();
    if (sourceClass.getName().equals("javax.swing.JButton")){
    JButton jb = (JButton) source;
    if (jb == go){
    crea_shares();
    }else if (jb == set_n){
    set_n();
    }else if (jb == op){
    load_file();
    }else if (jb == set_k){
    set_k();
    public void load_file() {
    JFileChooser fc = new JFileChooser();
    fc.setAcceptAllFileFilterUsed(false);
    fc.setFileFilter(new ImageFilter());
    int retval = fc.showOpenDialog(this);
    try{
    if (retval == JFileChooser.APPROVE_OPTION){
    original = fc.getSelectedFile();
    //String nome = original.getName();
    sorgente = ImageIO.read (original);
    ii.setImage(sorgente);
    picture = new ScrollablePicture(ii, 1);
    JSPanel = new JScrollPane(picture, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    this.getContentPane().add(BorderLayout.WEST, JSPanel);
    this.repaint();
    }catch (Exception e){}
    void close_frame(){
    System.exit(0);
    void scegli_formato(){
    Impostazioni i = new Impostazioni(0);
    void set_n(){
    Impostazioni i = new Impostazioni(2);
    void set_k (){
    Impostazioni i = new Impostazioni(1);
    Schema schema_corrente(){
    return curr;
    void cambia_schema(){}
    void guida(){
    void about(){
    void crea_shares(){
    public class Impostazioni extends JFrame implements ChangeListener{
    JTabbedPane panel = new JTabbedPane();
    Impostazioni(int i){
    FSS c1 = new FSS();
    SET_K c2 = new SET_K();
    SET_N c3 = new SET_N();
    panel.add("Formato shares", c1);
    panel.add("Modifica K", c2);
    panel.add("Modifica N", c3);
    panel.addChangeListener(this);
    if ( i == 0){
    panel.setSelectedComponent(c1);
    }else if ( i == 1){
    panel.setSelectedComponent(c2);
    }else if (i == 2){
    panel.setSelectedComponent(c3);
    getContentPane().add(panel);
    this.setResizable(false);
    this.setBounds(200, 200, 500, 300);
    this.setTitle("Impostazioni");
    this.setVisible(true);
    public void stateChanged(ChangeEvent e) {
    int pos = panel.getSelectedIndex();
    String title = panel.getTitleAt(pos);
    setTitle(title);
    public class FSS extends JPanel implements ActionListener{
    private JComboBox cb;
    private JLabel et;
    JLabel ico;
    Icon i1 = new ImageIcon("C:/forte/sampledir/Crypto/JPGIcon.jpg");
    Icon i2 = new ImageIcon("C:/forte/sampledir/Crypto/PNGIcon.jpg");
    FSS(){
    this.setLayout(new FlowLayout(FlowLayout.CENTER, 20, 30));
    int i;
    String item []= {"JPG", "PNG"};
    for (i = 0; i < 1; i++)
    if (item == formato) break;
    String msg = "\n\n\n\n\nIl formato attualmente in uso � "+formato+"\n\n";
    et = new JLabel(msg);
    add(et);
    JLabel et2 = new JLabel ("Modidica il formato di salvataggio delle shares ");
    if (formato =="JPG"){
    ico = new JLabel(i1);
    }else {ico = new JLabel(i2);}
    add (ico);
    add (et2);
    cb = new JComboBox(item);
    cb.setSelectedIndex(i);
    cb.addActionListener(this);
    add(cb);
    public void actionPerformed(java.awt.event.ActionEvent ae) {
    JComboBox cb = (JComboBox)ae.getSource();
    String selectedItem = (String)cb.getSelectedItem();
    int ind = cb.getSelectedIndex();
    formato = selectedItem;
    et.setText("Il formato attualmente in uso � "+selectedItem);
    if (formato == "PNG"){
    ico.setIcon(i2);
    }else{
    ico.setIcon(i1);
    public class SET_K extends JPanel implements ActionListener{
    private JLabel et3;
    SET_K(){
    this.setLayout(new FlowLayout(FlowLayout.CENTER, 40, 40));
    String msg = "Il valore attuale di k � "+k+"\n\n";
    et3 = new JLabel(msg);
    et3.setFont(new Font("Tim", Font.BOLD, 16 ));
    add (et3);
    JButton but2 = new JButton ("Modifica K");
    add (but2);
    but2.addActionListener(this);
    public void actionPerformed(java.awt.event.ActionEvent ae) {
    Object source = ae.getSource();
    int value;
    Class sourceClass = source.getClass();
    if (sourceClass.getName().equals("javax.swing.JButton")){
    Kappa kappa= new Kappa();
    value = kappa.get_K();
    if ((value > n) ||(value < 2)){
    JOptionPane err = new JOptionPane();
    String err_msg ="Errore, il valore di K deve essere un intero compreso tra 2 e " +n;
    err.showMessageDialog(null,err_msg , "Errore", JOptionPane.ERROR_MESSAGE);
    this.setVisible(false);
    }else{
    k = value;
    JOptionPane ok_ = new JOptionPane();
    ok_.showMessageDialog(null, "Modifica effettuata con successo. ");
    et3.setText("Il valore attuale di K � " +value);
    this.setVisible(false);
    public class SET_N extends JPanel implements ActionListener{
    private JLabel et4;
    SET_N(){
    this.setLayout(new FlowLayout(FlowLayout.CENTER, 40, 40));
    String msg = "Il valore attuale di n � "+n+"\n\n";
    et4 = new JLabel(msg);
    et4.setFont(new Font("Tim", Font.BOLD, 16 ));
    add (et4);
    JButton but3 = new JButton ("Modifica N");
    add (but3);
    but3.addActionListener(this);
    public void actionPerformed(java.awt.event.ActionEvent ae) {
    Object source = ae.getSource();
    int value;
    Class sourceClass = source.getClass();
    if (sourceClass.getName().equals("javax.swing.JButton")){
    Kappa kappa= new Kappa();
    value = kappa.get_K();
    if (value < k){
    JOptionPane err = new JOptionPane();
    String err_msg ="Errore, il valore di N deve essere un intero superiore o uguale a " +k;
    err.showMessageDialog(null,err_msg , "Errore", JOptionPane.ERROR_MESSAGE);
    this.setVisible(false);
    }else{
    n = value;
    JOptionPane ok_ = new JOptionPane();
    ok_.showMessageDialog(null, "Modifica effettuata con successo. ");
    et4.setText("Il valore attuale di N � " +value);
    this.setVisible(false);
    public int salva_schema(Schema s){
    String nome = s.get_name();
    nome = nome + ".ctm";
    try{
    FileOutputStream fos = new FileOutputStream (nome);
    ObjectOutputStream oos = new ObjectOutputStream(fos);
    oos.writeObject(s);
    oos.close();
    return 1;
    catch (Exception ioe){
    return -1;
    public Schema leggi_schema (String nome){
    try{
    nome = nome + ".ctm";
    FileInputStream fis = new FileInputStream (nome);
    ObjectInputStream ois = new ObjectInputStream(fis);
    Schema salvato = (Schema)(ois.readObject());
    ois.close();
    return salvato;
    catch (Exception ioe){
    return null;
    public static void main(String args[]){
    try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (Exception e) { }
    JFrame f = new Crypto();
    f.setVisible(true);
    package Crypto;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    /* ScrollablePicture.java is used by ScrollDemo.java. */
    public class ScrollablePicture extends JLabel
    implements Scrollable,
    MouseMotionListener {
    private int maxUnitIncrement = 1;
    private boolean missingPicture = false;
    public ScrollablePicture(ImageIcon i, int m) {
    super(i);
    if (i == null) {
    missingPicture = true;
    setText("No picture found.");
    setHorizontalAlignment(CENTER);
    setOpaque(true);
    setBackground(Color.white);
    maxUnitIncrement = m;
    //Let the user scroll by dragging to outside the window.
    setAutoscrolls(true); //enable synthetic drag events
    addMouseMotionListener(this); //handle mouse drags
    //Methods required by the MouseMotionListener interface:
    public void mouseMoved(MouseEvent e) { }
    public void mouseDragged(MouseEvent e) {
    //The user is dragging us, so scroll!
    Rectangle r = new Rectangle(e.getX(), e.getY(), 1, 1);
    scrollRectToVisible(r);
    public Dimension getPreferredSize() {
    if (missingPicture) {
    return new Dimension(320, 480);
    } else {
    return super.getPreferredSize();
    public Dimension getPreferredScrollableViewportSize() {
    return getPreferredSize();
    public int getScrollableUnitIncrement(Rectangle visibleRect,
    int orientation,
    int direction) {
    //Get the current position.
    int currentPosition = 0;
    if (orientation == SwingConstants.HORIZONTAL) {
    currentPosition = visibleRect.x;
    } else {
    currentPosition = visibleRect.y;
    //Return the number of pixels between currentPosition
    //and the nearest tick mark in the indicated direction.
    if (direction < 0) {
    int newPosition = currentPosition -
    (currentPosition / maxUnitIncrement)
    * maxUnitIncrement;
    return (newPosition == 0) ? maxUnitIncrement : newPosition;
    } else {
    return ((currentPosition / maxUnitIncrement) + 1)
    * maxUnitIncrement
    - currentPosition;
    public int getScrollableBlockIncrement(Rectangle visibleRect,
    int orientation,
    int direction) {
    if (orientation == SwingConstants.HORIZONTAL) {
    return visibleRect.width - maxUnitIncrement;
    } else {
    return visibleRect.height - maxUnitIncrement;
    public boolean getScrollableTracksViewportWidth() {
    return false;
    public boolean getScrollableTracksViewportHeight() {
    return false;
    public void setMaxUnitIncrement(int pixels) {
    maxUnitIncrement = pixels;

    Instead of "new ImageFilter()", use this file filter:
    public static javax.swing.filechooser.FileFilter SOLOMENTE_JPG_GIF_PNG=
    new javax.swing.filechooser.FileFilter(){
    public String getDescription(){
    return "jpg, gif, o png";
    public boolean accept(java.io.File file){
    String n= file.getName();
    return n.endsWith(".jpg") || n.endsWith(".gif") || n.endsWith(".png");
    public void load_file() {
    JFileChooser fc = new JFileChooser();
    fc.setAcceptAllFileFilterUsed(false);
    fc.setFileFilter(SOLOMENTE_JPG_GIF_PNG); // <-- NUEVO
    int retval = fc.showOpenDialog(this);
    try{
    if (retval == JFileChooser.APPROVE_OPTION){
    original = fc.getSelectedFile();
    //String nome = original.getName();
    sorgente = ImageIO.read(original);
    ii.setImage(sorgente);
    picture = new ScrollablePicture(ii, 1);
    JSPanel = new JScrollPane(picture, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    this.getContentPane().add(BorderLayout.WEST, JSPanel);
    this.repaint();
    }catch (Exception e){}

  • How can i  create and access resource file(with .res ext) in j2me

    hi,
    i am developing an mobile international application using jsr-238 an optional api to implement the idea of internationalizationand localization.
    please tell me how can i create .res files in my application to store strings of different languages.thanks inadvance.

    Hello GG RA,
    which fileformat do you want to use (binary or ASCII)?
    There are some LabVIEW shipping examples for File I/O
    You could use the LabVIEW NI Example Finder (Help --> Find Examples..(search item "file")) to get an overview about the different file-formats in LabVIEW.
    Hope this helped out and feel free to reply if you have more questions about File I/O in LabVIEW
    Best regards
    Benjamin

  • How can I create an iPhoto Library from photos on an external drive?

    Here's my issue:
    I have a MacBook Pro running OS X Mavericks, and I am just about out of hard drive space.
    I also have about 20 GB worth of photos on an external drive. The photos are not organized at all, just got dumped into a folder there during a hasty backup a couple years ago.
    I'd like to use iPhoto to get these photos organized, but don't have the space to import them into the library on my laptop.
    How can I create and manage an iPhoto library with these photos while keeping them on the external drive? They are on a terabyte drive, so I have a feeling I'd like to make that my main library moving forward.

    Check that the drive's formatted as Mac OS Extended, drag the iPhoto library to it, launch iPhoto with the Option key held down, and choose that library.
    (114618)

  • How can you create a spry menu bar with no background colour?

    How can you create the first level of a spry menu bar to have no colour? I have a coloured background right now and the colour matches when you load the site in Internet explorer but does not match in Firefox. Any suggestions are welcomed on how to fix this.
    Thanks!
    HK

    Here is the site:
    http://partnersnaturally.ca/
    I am learning with code, (obviously) so any feedback would be nice. I use dreamweaver CS4, but when I originally designed the site it was in a much older version of dreamweaver. I wonder if that could also be a cause. (besides human error)
    Thanks again,
    HK

  • How can you create a playlist with music and music video and play those from same playlist through Apple TV?

    How can you create a playlist on Ipod touch with music and music video,  and play those from same playlist through Apple TV?  I can download, create a playlist with both music and music video, stream that through the Apple TV with no problem.  The sound and the information show up on the TV, but when it gets to a music video, it only shows the information and "artwork".
    I also have a video playlist - videos play fine through the Apple TV, but will not shuffle through all videos - continues to repeat the same one.  I have most definitely selected shuffle in both locations - from the playlist and on the ipod video screen while video is playing.

    I finally got it... had to sync the photos with the music in iMovie, arrange the voiceover in GarageBand then export to iTunes, and then I was able to put it all together in iMovie and burn in iDVD... had a few glitches along the way but finally finished : )
    Message was edited by: jpewald

Maybe you are looking for

  • How to install arch 2009.08 from hard drive? Please enlighten me

    OK, I admit I am impatient for the installation from the CD drive. Whenever possible and whatever distro I wanna try, I head first to try to install it from the hard drive. I don't remember how many times and how many distros I have done the same to,

  • Adobe Acrobat Pro XI vs X Accessibility Checks

    I have a Adobe Acrobat Pro XI. My client has Adobe Acrobat Pro X. In XI, my documents are completely accessible, but when they run the accessibility check in X they show errors. The client will send documents back to us as non-compliant due to these

  • How to read a spread sheet ( .xls ) file using a pl/sql procedure or func

    Hello All, Is it possible to read a spread sheet using Oracle pl.sql . I know their is a util package that is read a file but how to read a spread sheet ... ? thanks kumar

  • "Memory Full" error when changing page setup

    I'm running Crystal Reports 2008 and yesterday I had two landscape reports begin doing some weird things: Symptoms: -Any change to the Page Setup dialog throws the Memory Full error (even just bringing it up and clicking ok) -The reports were created

  • Adobe CS5 Trial Install Problem

    I have tried to install the Adobe Photoshop CS5 trial, but it always comes up with this error, and says Photoshop failed to install, even after reaching 100%. Here are my specs: Windows XP Home Edition Service Pack 3         Enclosure Type: Desktop 2