我正在我的安卓项目中动态显示一些VectorDrawable图标。但是,我无法使用以下代码缩放java层中的图标:
VectorDrawable jDrawable = (VectorDrawable) getContext().getDrawable(nResourceID);
// resize the icon
jDrawable.setBounds(30, 30, 30, 30);
// set the icon in the button view
button.setCompoundDrawablesRelativeWithIntrinsicBounds(jDrawable,
我想将我的类的字段名列表以及它们各自的值添加到一个Java JFrame中。当然,这些字段可以在程序执行期间更改值,我希望这种更改能够动态显示在我的GUI中。例如,如果我在类BaseStation中有一个字段private int networkId;,我如何才能使它出现在类BaseStationFrame的框架中