java - Checking which raidoButton in a ButtonGroup is selected? -


i created both 2 radiobuttons , buttongroup in swing. "radioascending", "radiodescending", , "buttongroupascdsc" respectively. when "radioascending" selected, array sorted in ascending order, , vice versa. however, when try check if 1 of 2 selected:

if (radioascending.isselected()) {     arrays.sort(alphaarray, (string[] s1, string[] s2) -> s1[0].comparetoignorecase(s2[0]));     alphamodel = new defaulttablemodel (alphaarray, columns); } 

the top line gives error:

non-static variable radioascending cannot referenced static context 

the code have provided doesn't show much, error looks calling variable radioascending not static (not marked keyword static) method marked static static, not allowed.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -