Questions tagged [setbackground]

134 questions
0
votes
2 answers

How to use txtV1.setBackground(getResources().getDrawable(R.drawable.bcgrtxt));`in Older Devices?

How to use txtV1.setBackground(getResources().getDrawable(R.drawable.bcgrtxt)); in Older Devices ?
Hossam Hassan
  • 595
  • 1
  • 7
  • 19
0
votes
1 answer

change color of item in listview (without click)

I've tried to change the background color of specific items in a ListView. first, catch it from database: ListAdapter adapter = new ArrayAdapter(getApplicationContext(), android.R.layout.simple_list_item_1, db.getAllApps()); …
0
votes
2 answers

Animate bg color with hsb model Java

I'm fairly new to java, so i don't think I have this fairly close to right, but I can seem to find any other help with this. Basically, I'm trying to animate a jPanel's background color so that it's hue (I'm using an hsb color model) changes. sort…
0
votes
1 answer

Strange setBackground() error - Java Swing

import java.awt.*; import javax.swing.*; public class JFrameGUI extends JFrame { JLabel item1; public JFrameGUI(int l, int b , String Title) { setTitle(Title); setLayout(new FlowLayout()); setSize(l, b); …
0
votes
1 answer

Highlight current touched item as selected item

I have a android file explorer application and I need to highlight the selected item. I could select touched items using v.setBackgroundColor() method inside onListItemClick(). But when I touch another file/folder still previous one highlighted. I…
IBunny
  • 289
  • 7
  • 20
0
votes
3 answers

For a Custom JLabel (shape changed) setbackground method paints the rectangle and not the new shape

I have created a custom label by overriding the paintComponent() method as shown below. But when I call the setBackground() method on this component. It paints the entire rectangle. I want it to paint only the custom shape.Please help. Custom Label…
Soniya Chavan
  • 73
  • 1
  • 9
0
votes
1 answer

java.lang.OutOfMemoryError setBackgroundResource

I have different buttons for loading images in imageview. when the user clicks the first button 10 images are loaded when the user clicks the second button load more images 10, and the other 10 images are not displayed, but when he click the third…
Gioele
  • 73
  • 1
  • 11
0
votes
3 answers

Linear Layout background not showing at all

I set linear layout background as usual by android:background="@drawable/xxx" but it not shown at all both on eclipse as well as on device. My XML file is given below :
huzefa p
  • 109
  • 7
0
votes
1 answer

Set background color for customview?

I have a custom view and I have to set background color for it every two seconds.I can use canvas.drawARGB() or view.setBackgroundColor().Both change color but I need to increase performance,because that change repeats every two seconds.So I want to…
hasanghaforian
  • 13,142
  • 8
  • 71
  • 144
0
votes
1 answer

JApplet setBackground not working

I am wondering why the method setBackground() is not actually making the background black. I have feeling this has something to do with the class implementing JApplet as opposed to Applet but I can not figure out the specifics. It's really bugging…
0
votes
1 answer

Android using switchpreference to set color background

How can I change the color of the app I'm trying to develop. I have used a switch statement under preferences menu, but do not know how I can code this, so that when the user clicks on the switch, the background color is changed across the whole…
0
votes
1 answer

Background Change gives Force Close

I just made a little code to make my Background change to a Drawable if the Checkbox in my Preferences is checked, and make it go white when it isn't. The code works fine in my MainActivity, but it gives a NullPointerException in another Activity…
TimeWasterNL
  • 102
  • 5
0
votes
1 answer

add two background image for selected and unselected UISegments iphone

I have two segment buttons (1 and 2) I want to add a background image one for selected segment and another image for unselected segment.How can I do that? Here is what I have so far,should I set the background image here?: -…
john MacL
  • 49
  • 1
  • 6
0
votes
0 answers

Android random black screens due to asynctask or something else when switching activities

I created an app which works fine on emulators but sometimes, when switching from an activity to another on a real device (Samsung Note 2), i get a black screen and then after one second, I am forwarded to my previous activity. Anyone had the same…
0
votes
1 answer

Window setBackGround: causes runtime errors

I added a background color to the window of a well-running simple draw project and build succeeded. Then the fun began: runtime errors appeared in the console window. I found no help in Apple docs and Google. When the same happened in another draw…
j yrez
  • 213
  • 3
  • 11
1 2 3
8
9