custom-component

Changing the background color of a selected JToggleButton

白昼怎懂夜的黑 提交于 2019-11-26 23:35:27
问题 I am trying to change the color of a JToggleButton when it has been selected in a reliable, look and feel independent way. If using the Metal L&F, then using the UIManager is an approach: UIManager.put("ToggleButton.selected", Color.RED); Note : Iyy pointed out that I had a typo in the property name above, but I will leave it above for people getting here, but the actual property name is supposed to be: UIManager.put("ToggleButton.select", Color.RED); However, this does not work in my current

Creating Custom ImageView

耗尽温柔 提交于 2019-11-26 23:12:02
问题 I create a custom image view by extending ImageView that just draws some text on the screen, however I don't see anything painted in the Emulator Screen, but the log messages and the printlns get printed in the log console. Am I not doing something? This is my activity public class HelloAndroidActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // setContentView(R.layout

custom java Swing component Model, UIDelegate, component format

大兔子大兔子 提交于 2019-11-26 21:43:49
问题 I was given the task to create a custom swing component. I have my component functioning properly in a test application which includes JSlider that is used to zoom in and out on an Image. However I am required to present my custom component in a Model, UIDelegate, and Component class format and I am totally lost on how to convert my code so that it follows this format. Here is the code for my test application. package test; import java.awt.*; import java.awt.geom.AffineTransform; import java

TypeArray in Android - How to store custom objects in xml and retrieve them?

耗尽温柔 提交于 2019-11-26 20:11:56
问题 I have a class like public class CountryVO { private String countryCode; private String countryName; private Drawable countryFlag; public String getCountryCode() { return countryCode; } public void setCountryCode(String countryCode) { this.countryCode = countryCode; } public String getCountryName() { return countryName; } public void setCountryName(String countryName) { this.countryName = countryName; } public Drawable getCountryFlag() { return countryFlag; } public void setCountryFlag

Android - Writing a custom (compound) component

梦想的初衷 提交于 2019-11-26 15:03:54
问题 The Android app I'm currently developing has a main activity that has grown quite large. This is mainly because it contains a TabWidget with 3 tabs. Each tab has quite a few components. The activity has to control of all those components at once. So I think you can imagine that this Activity has like 20 fields (a field for almost every component). Also it contains a lot of logic (click listeners, logic to fill lists, etc). What I normally do in component based frameworks is to split

Creating a component with named sub-components?

寵の児 提交于 2019-11-26 11:15:28
问题 I need to know the basics behind making a component produce and manage sub-components. I originally tried this by creating a TCollection , and tried to put a name on each TCollectionItem . But I learned it\'s not that easy as I had hoped. So now I am going to start this project from scratch again, and I\'d like to get it right this time. These sub-components are not visual components, and should not have any display or window, just based off of TComponent . The main component holding these

When to use <ui:include>, tag files, composite components and/or custom components?

三世轮回 提交于 2019-11-25 23:56:34
问题 I started using JSF 2.0 with Facelets recently and got puzzled by new composite components knowing existing <ui:include> and other templating techniques offered by Facelets 1.x. What is the difference between those approaches? Functionally they seem to offer about the same: <ui:param> vs <cc:attribute> , <ui:insert> + <ui:define> vs tag files, reuse of the existing templates. Is there anything besides syntax and clear interface specification in case of composite components? Could performance