Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Border

MongloidooMongloidoo Member Posts: 52
Is it possible to add a border around a radio button? if so, how can i do so?

Comments

  • creonnoircreonnoir Member Posts: 21
    [b][red]This message was edited by creonnoir at 2002-9-20 0:34:58[/red][/b][hr]
    : Is it possible to add a border around a radio button? if so, how can i do so?
    :

    Anything that is derived from JComponent (which is all swing components, except for top-level containers) can have custom borders set, the syntax is below:

    [code] JRadioButton mybut = new JRadioButton;
    //using a custom border
    mybut.setBorder(MyCoolBorder);
    // or, using static BorderFactory methods
    mybut.setBorder(BorderFactory.createEtchedBorder());
    [/code]




  • creonnoircreonnoir Member Posts: 21
    : : Is it possible to add a border around a radio button? if so, how can i do so?
    : :

    Scratch the last post, I hadn't tried it with JRadioButton and I thought I should test it, it doesn't work! A simple workaround would be to use a JPanel, which does support .setBorder(), and add the JRadioButtons to the JPanel.
  • Chris BrownChris Brown USAMember Posts: 4,496 ✭✭

    _______ ( http://forcoder.org ) free ebooks and video tutorials about [ Delphi, JavaScript, R, Visual Basic, C#, Scratch, PL/SQL, Ruby, MATLAB, Objective-C, PHP, Assembly, C, Perl, Java, C++, Go, Swift, Visual Basic .NET, Python Ada, Transact-SQL, Scala, FoxPro, Fortran, Erlang, Julia, Crystal, Kotlin, Awk, Lisp, Clojure, VBScript, Apex, ML, Rust, Dart, Hack, Lua, Alice, Prolog, LabVIEW, Scheme, D, ABAP, COBOL, Bash, SAS, Logo, F# ] _____________

Sign In or Register to comment.