Visualizzazione dei risultati da 1 a 3 su 3

Discussione: jbutton

  1. #1
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    68

    jbutton

    ciao!
    volevo sapere questo.
    ho un pulsante su cui devo mettere del testo e un'iconcina
    come faccio a stabilire io la loro disposizione? per esempio, se volessi mettere
    l'icona tutta a sinistra e il testo centrale.
    grazie
    fla

  2. #2
    Utente di HTML.it
    Registrato dal
    Dec 2003
    Messaggi
    23
    I metodi a disposizione sono forniti dalla classe AbstractButton che è un antenato di JBotton, che quindi li eredita. I metodi sono questi:

    public void setVerticalAlignment(int alignment)
    Sets the vertical alignment of the icon and text.

    Parameters:
    alignment - one of the following values:
    SwingConstants.CENTER (the default)
    SwingConstants.TOP
    SwingConstants.BOTTOM

    public void setHorizontalAlignment(int alignment)
    Sets the horizontal alignment of the icon and text.

    Parameters:
    alignment - one of the following values:
    SwingConstants.RIGHT (the default)
    SwingConstants.LEFT
    SwingConstants.CENTER
    SwingConstants.LEADING
    SwingConstants.TRAILING


    public void setVerticalTextPosition(int textPosition)
    Sets the vertical position of the text relative to the icon.

    public void setHorizontalTextPosition(int textPosition)
    Sets the horizontal position of the text relative to the icon.

    Parameters:
    textPosition - one of the following values:
    SwingConstants.RIGHT
    SwingConstants.LEFT
    SwingConstants.CENTER
    SwingConstants.LEADING
    SwingConstants.TRAILING (the default)
    Throws:
    IllegalArgumentException - if textPosition is not one of the legal values listed above

  3. #3
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    68
    grazie!
    proverò!
    fla

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.