Long canvas with scroll bar

Hi. I have a form with a very long canvas containing more items than fit on the screen at a time - meaning some items are far down on the canvas and do not appear unless the user physically uses the mouse and scrolls down. This causes a problem for me because as the user tabs through the various fields the cursor will eventually "appear" to disappear. It has not actually disappeared of course, but it has simply navigated to an item that is further down on the canvas out-of-sight. Thus the user must recognize that this has happened and then use the mouse to scroll down and find the cursor again.
Is there a way to automatically coordinate this scrolling so that the cursor always stays in view for the user - meaning that the user will never have to manually scroll down to find the cursor? Or worst case, can I programatically scroll down for the user so that the cursor always remains visible?
Any help would be greatly appreciated. If you have any sample code please send it to: [email protected]
Thanks in advance.
Edited by: Buechler on Jun 30, 2009 12:20 PM

-> 3) Changed the default Window width to 5 and it's height to 12
Don't do that. That apparently guarantees the problem you have.
The Window size should be no larger than will fit on the user's screen, and the user running the lowest screen resolution should be your target. We create forms no larger than will fit on the 800x600 layout. Our forms always use the Real,Pixel coordinate system, and I create forms with the window size set to a maximum of 784x442. Those reduced numbers allow the form to fit within a browser window in web forms. Our forms run under both 6i Client/Server AND Web, and there is a pre-form that adjusts the web form window size a little larger, but that is all.
Also, when you run your form, that scrollbar you see is there because your window is not maximized. Our forms always maximize the window, and even have a when-window-resized trigger with this:
<pre><font face = "Lucida Console, Courier New, Courier, Fixed" size = "1" color = "navy">DECLARE
W0 Window := Find_Window('WINDOW0');
BEGIN
If Get_Window_Property(W0,Window_State)<>'MAXIMIZE' then
Set_Window_Property(W0,Window_State,Maximize);
End if;
END;</font></pre>
The wwr trigger ensures the user never sees the Window0 border -- it is useless unless you are running a form with multiple windows, which we never do.
So.... Maximize your Window0, and then you will see the behavior I have been describing. Create a stacked canvas with a vertical scrollbar, and it will behave even better.

Similar Messages

  • The problem of using timer in long windows with scroll bar

    Hello everybody!
    There is a problem of using timer in windows with scrolling. Lies in the fact that at the moment of the trigger "when-timer-expired", is "jumping" on the active field in the form (where the cursor). If the user scrolls at this moment unscrewed to view another location below, or higher, then it will then "jump" from the viewing area.
    I tried to fix the problem by replacing the timer in Forms, a timer in the JavaBean.
    It did not help. At the moment of the trigger WHEN-CUSTOM-ITEM-EVENT of JavaBean, anyway there is a jump.
    I have not a few forms, but only one form. With one long window.
    I use Oracle Forms 10.1.2.3.
    The forum discussing this problem. But it has not been resolved, I think. It is also proposed to destroy and recreate the timer at the transition between the forms. But the form I have just one!
    Has anyone encountered this problem? What are the solutions?

    CraigB wrote:
    Could you explain the overall affect you are going for? Perhaps if we knew what you were trying to achieve we could offer potential solutions that don't involve using a Timer or perhaps a differnt way to use the Timer.
    Craig...No.
    In different tasks, different purpose of timer. Can I use the timer without jumps?

  • Problems with scroll bars in list view

    Hello,
    I am using Xcelsius 2008 (Build Number 12,2,166).  I am still having trouble with scroll bars on my list view control. Other list views in my dashboard seem to be ok. It seems that this list view is not ignoring the blank cells in my excel file. I have gone through many things to correct this problem. I have added a new list view, I have copied other list views that work correctly but still no success. It seems that the "Ignore Blank Cells" property is not working correctly. Does anyone have a solution for this?
    Much Thx!

    Hi Yusufel,
    Please check the data whether the cells are really blank or having any space which could not be seen, etc.
    With best wishes
    BaaRaa.

  • Stack Canvas Horizontal Scroll Bar

    Hi There,
    I'm using Forms 6i (Rel.2) and i am facing a problem with may stack canvas's horizontal scroll bar at runtime, as follows:
    As I put the cursor on an Item inside the stack canvas, and try to scroll away to the left where that Item is no longer viewable, and then stop scrolling, the scroll back will jump back to that Item,so I have to press and hold the mouse on the scroll bar as long as I need to see other Items at the far end! I tried to set the "Raise on entry" property to "YES", but no success.
    I tried the same in Forms 5 and it works fine with no problems at all!!!
    Any suggestions?

    Hi,
    My colleague found out that a timer I had programmed in a calling form to show the current time was actually refreshing every one second and in doing that it was refreshing the whole view which caused it to jump back to the first item. I had to remove the timer and it's working fine now.
    Thanks again,
    Ali

  • ICal - long notes disappear/scroll bar problem

    I'm having issues typing in long notes in iCal. When I'm typing in the "Note" field, and I'm typing a lot, at some point my text disappears below the bottom of the pop up box (e.g. the box doesn't keep scrolling down as I type). Then I have to manually click and drag the scroll bar down to reveal what I just typed. But if I start typing again, the scroll bar jumps back up, hiding what I'm typing again. Has anyone else experienced this?

    -> 3) Changed the default Window width to 5 and it's height to 12
    Don't do that. That apparently guarantees the problem you have.
    The Window size should be no larger than will fit on the user's screen, and the user running the lowest screen resolution should be your target. We create forms no larger than will fit on the 800x600 layout. Our forms always use the Real,Pixel coordinate system, and I create forms with the window size set to a maximum of 784x442. Those reduced numbers allow the form to fit within a browser window in web forms. Our forms run under both 6i Client/Server AND Web, and there is a pre-form that adjusts the web form window size a little larger, but that is all.
    Also, when you run your form, that scrollbar you see is there because your window is not maximized. Our forms always maximize the window, and even have a when-window-resized trigger with this:
    <pre><font face = "Lucida Console, Courier New, Courier, Fixed" size = "1" color = "navy">DECLARE
    W0 Window := Find_Window('WINDOW0');
    BEGIN
    If Get_Window_Property(W0,Window_State)<>'MAXIMIZE' then
    Set_Window_Property(W0,Window_State,Maximize);
    End if;
    END;</font></pre>
    The wwr trigger ensures the user never sees the Window0 border -- it is useless unless you are running a form with multiple windows, which we never do.
    So.... Maximize your Window0, and then you will see the behavior I have been describing. Create a stacked canvas with a vertical scrollbar, and it will behave even better.

  • Content canvas to stacked canvas for scroll bars

    I have a form which has more items. Initially I developed the form with content canvas(this has vertical scroll bar). now I changed this canvas to stacked canvas to get horizontal + vertical scroll bar. But I am not able to do it. Can any one please advice me how to achieve. Basically I need horizontal + veritcal scroll, so that user can easily scroll it.
    Appreciate your help.
    Thanks in Advance!!

    Hi
    This is a common task in Oracle Applications forms, the steps would be:
    - Put the context, fixed fields on content canvas, to the left of the window
    - Modify the block to show vertical scroll bar, display it on content canvas, to the right of the window
    - Accommodate remaining fields on stacked canvas, all of them from 0.0 to the right.
    - Modify stacked canvas viewport size and position to be shown in the space between the fixed fields on the content canvas and the vertical scrollbar on it, allow for space to the horizontal scrollbar
    - As Craig's answer states, modify stacked canvas property to show horizontal scrollbar

  • CSS -- background color doesn't show with scroll bar

    I have a nav bar with a background-color that shows up fine if the image opens to the right size.  If, however, the window opens small and I have to use the scroll bar to move things over, the color for the nav bar isn't there.
    Any thoughts would be appreciated.
    Here's the code:
    HTML:
    <body>
        <div id="Global">
            <div id="navHeader">
                <div id="navBar">
                    <ul class="navStyle">
                        <li>Home</li>
                        <li>Chamber Info</li>
                        <li>Event Galleries</li>
                        <li>Contact Us</li>
                        <li>Join</li>
                    </ul>
                </div>
            </div>
        </div>
    </body>
    CSS:
    @charset "utf-8";
    /* CSS Document */
        padding:0 0;
        margin:0 0;
    body{
        background-color:#f1eee3;
    #Global{ margin:0 auto;}
    #navHeader{
        width:100%;
        height:40px;
        margin:0 auto;
        background-color:#bfbfbf;
    #navBar{
        margin: 0 auto;
        width:960px;
        text-align:center;}
    .navStyle{
        font-family:"Eras Medium ITC",Arial, Helvetica, sans-serif;
        font-size:18px;
        padding-top:10px;
    .navStyle li{
        display:inline;
        padding-left:20px;
        padding-right:20px;

    Does this help?
    #navHeader{
    width:100%;
    min-height:40px;
    _height:40px; /**for IE6 only**/
    margin:0 auto;
    background-color:#bfbfbf;
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com

  • List Box display to synchroniz​e with Scroll bar.

    I will like to know if anyone here can help to amend or advise on the attached VI in order to allow the List Box display to synchronize with the Scroll bar.
    As the VI is in run mode, i would like to see 9.CD, 10.Troja, 11. Red... and so on to be displayed as it is being executed.
    Thanks.
    Attachments:
    try.vi ‏13 KB

    Hi Gelb,
    Glad to hear you've got it working
    I realised afterwards that my code will not work correctly if the last line is partially hidden, ie the list box does not display an exact number of lines. So I've added a +1 after the array size function to correct this, see attached vi.
    You'll notice that I read the NumRows property of the listbox - I've done this so that if you decide to change the listbox height the code will still work without you having to go in and change anything. In your code you would have to change the constant (currently a 7) before the comparison primative to the new height. Also, in my new vi I've assumed the listbox height isn't going to change during the time it gets populated so I've move the NumRows property out of the for loop and read it only once - saves a bit of time
    Using a for loop with auto indexing rather than a while loop also means that I don't need to index the input array every time or worry about when the loop will stop.
    Hope this all helps
    Dave
    Message Edited by DavidU on 06-26-2008 08:59 AM
    Attachments:
    Scroll Listbox 2.vi ‏15 KB

  • Since 10.4.4 safari has problem with scroll bar visualization...

    after the install of x.4.4 i have a strange occurance with safari. as seen here: http://dcxkid.case.edu/Picture%201.png the scroll bar becomes part of the web page image, and scrolls with the page, but becomes dysfunctional as a scroll bar. if i scroll back up, it sometimes goes away... if i wait when the page first loads, the scroll bar may completely disappear. what gives? any ideas or suggestions?
    pb 12''' 1.5 768mb ram   Mac OS X (10.4.4)  

    The same thing happened to me sometime in November, I think. It was working, and now it only zooms in except when I spin the wheel rapidly down through multiple detents (logitech mouse). Double checked it in a newly created account. Same thing happens. Works fine in Firefox but I like using Safari.

  • How can I get a tab to open in an oversize jpg image in its original size with scroll bars when I click on a link?

    I have a small program for storing my genealogy names and jpg images of the census pages where each name is found. The images have a thumbnail link that opens in a new tab to view the actual oversized census page. In the new tab the census page is small and not readable. How do I get the jpg image to appear in its original size with schroll bars so I can read the census in the firefox browser without using the zoom feature. It takes several clicks on the zoom to get the image to a readable size and that is time consuming, especially when I have several images opened.

    That works, thank you!
    Could I suggest that this feature (the ability to turn off or turn on the auto-resize of images) be part of the Options tab on Firefox? I think it's a setting that some users might want to change fairly often--even toggle back and forth on. It's a little annoying to have to go into about:config every time to do this.

  • ADF table - problem with scroll bar

    Hi all,
    I am using Jdev 11.1.1.0.1. I have a Read only View object that retuurns more than 2 million records. When i add this VO to the jspx page as an ADF read only table, scrollbars are not applied. Here is the page layout.
    <f:view>
    <af:document>
    <af:messages>
    <af:form>
    <af:panelGroupLayout layout="scroll">
    <af:table inlineStyle="width:100%; height:400px;">
    </af:table>
    </af:panelGroupLayout>
    </af:form>
    </af:document>
    </f:view>
    the table's range size is set to 25. What could be the wrong here? I have also tried using ContentDelivery - Immediate and AutoHeightRows - 20. But that also didn't work. this approach worked fine for tables that have less number of records.
    Pls help me with this.
    Thanks.

    Can you try and print out the estimated row count on the page to get the real number? #{binding.Iteratorname.estimatedRowCount}should do it.
    If this gives the right number you can try to find out if it is a bug in the framework by overwriting the method getQueryHitCount in the VO in question and just return a fictive number
        public long getQueryHitCount(ViewRowSetImpl viewRowSet)
            return 5000;
        }If you then see the scrollbar you can increase the number and find out when the scrollbar disappears.
    Timo

  • EDGE and HTML dynamic text in a "box" with scroll bar

    I'm new to EDGE, a win7pro master collection cs5.5 suite owner. I'm mainly in the Film/Video post production field (mostly AE, PPro, Pshop, IA) but have been branching into web design the last couple of years.  I use Dreamweaver, Fireworks, Flash. While I'm a expert user with all the Film/video apps, I would say I only have intermediate ability with the web apps. While I understand a lot of programing logic bulding blocks I'm not a coder.
    So since we're told "flash is dead",  my interest in Edge is to try to do some of the things that I can currently do in flash in  EDGE. I was excited when Edge first came out but lost interest when it became obvious that Adobe was not going to offer Edge and Muse to "suite owners" but only in their force feeding of the "Cloud". Better known as the "golden goose" for adobe stockholders and a never ending perpetual hole in the pocket for users. Anyway....
    I spent the last couple of days doing some of the tuts and messing with the UI. It's matured a lot since I was here last.
    I've been working on a flash site for a sports team where one of the pages is a player profile page where college recuriters and other interested parties can view recuriting relavent info/stats about players. This is how it works. While on the "Team" page a users clicks on  a button labled "Player Profiles" . (Animation) A "page" flies in and unfurls from the upper right corner (3d page flips effect created in AE played by flash as a frame SEQ). Once it lands filling most of the center of the screen there is a bright flash. As the brightness fades we see the "page" is a bordered box with a BG image of a ball field(End). (Animation) from behind the border in fly small pictures (player head shots with name and jersey number). They stream in and form a circle like a wagon train and the team logo zooms up from infinity to the center of the circle(End). As the user mouses over a player's pic it zooms up a little and gets brighter (like mouseover image nav thumbs for a image slider). If the user clicks on a player's head shot it flips over and scales up to become a text box with a scrollbar. The content of the box is a mix of images, static and dynamic text fields populated from data in an "player info data base" XML file, and some hyperlinks. It's all kept updated dynamicaly with current stats, info and images from the XML file. There is also a "PDF" button that allows the user to open/save/print a PDF of the player's profile (the PDF's are static files for now but the choice of which pdf to retrive is dynamicaly supplied via the XML file.
    So.... Is Edge now able to do something like this?  Would it need to be a collection of small animations? could these be "assembled" and connected as an asset in dreamweaver ?
    I thought I would approach this from the end (ie click on an image and display a box with dynamic TEXT fileds. ) since that is the most important part, ie displaying the dynamicaly updated profile info.  Sooooo....
    Can Edge display a scrolling text box with Images, static text, and html dynamic text in it??
    Joel

    The code is in composition ready. Click the filled {}

  • Stacked Canvas with Title Bar

    Hi , Is it possible to add a title bar on top of the stacked canvas ? Thanks.

    where the title name can be displayed , like title name on top of a window.  anyway,  i have created a new window same size as the stacked canvas and displaying the title name now . Thanks for your response.

  • 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

  • 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){}

Maybe you are looking for

  • Dual boot (Win XP - ARCH 0.8) / disk 80 GByte

    Hi, I am trying to setup DUAL Boot Windows-XP Archlinux on a Compaq nc6320 I want to load linux  from the Window NT loader I have only a " - "  in the left uppercorner when I select --linux-- [boot loader] timeout=30 default=multi(0)disk(0)rdisk(0)pa

  • Interactive report column order not working properly

    Hi All, Can anyone help me with this situation: Example: 1) First of all I created a interactive report with this simple query Select 1 col_A, 2 Col_D from dual 2)Later I modified the query like this Select 1 col_A, 1 col_C, 2 Col_D from dual But whe

  • Can I use 3D in PS CC?

    Can I use 3D in PS CC? If so why is it grayed out? What image format does it recognize? Will it render a multi level image with a flat back? Like a family crest with florals, helmets, crosses, castles and such? I have the Cloud and both Photoshop CS6

  • How do i count the rows??

    hello, i have a database from where I import a table. now, because of my data-structure i need to know the nubmers of row in my table. For that i don't want to use the sql-statement: select count(*) .... but instead I want to use a java JDBC function

  • Standards or Best Practices on limits to Adobe LiveCycle forms as data input tools?

    We are trying to determine whether we should be using Adobe LiveCycle forms for our user input pages, or use a web input form (jsf) that is part of the application server. The data captured would then be rendered in multiple output forms. (printing,