• Post Reply Bookmark Topic Watch Topic
  • New Topic

checkbox

 
seema chhetri
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

please tell me how i can Remove the Gap between the checkbox and icon.



thanks
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try out setIconTextGap()
 
seema chhetri
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



HELLo ,


thanks for repplying but there is little different question:

I have an Jtree in which there is gap between the nodes and nodes contain the icon and checkbox.
so the gap between the nodes have to remove.

its urgent.


thanks
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using renderers for your nodes?
Can you post a code which we can try out to get a better understanding of your problem?

Also please ease up
 
seema chhetri
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take a look at the link I had provided in my previous reply.
You should be posting a code, which people can run on their own system.
The code you have provided doesn't compile because of OdiSAPERPAdapter and OdiSAPERPLogger classes.
Also, in future, while posting code, please use the code tags http://faq.javaranch.com/java/UseCodeTags
 
seema chhetri
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

hello

i am using same cell renderer only difference is that i am using custom way.

please tell

its urgent
thanks
 
seema chhetri
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seema chhetri wrote:
hello

i am using same cell renderer only difference is that i am using custom way.
rest of the nodes are coming right but where ever checkbox is there that node and between that nodes gap is too much

as checkbox is in only in specific place not in whole Jtree. as there is a Jtree in which it is fetching a data from somewhere so nodes are not predefine that is get fetch by the somewhere.if suppose the fetch data - Jtree - contain - modules- contain tables and application component . we only have a checkbox in tables .
icon is in whole tree now a problem is that where ever the checkbox is coming the Gap Between The Nodes are too much.

please tell me the solution or send me the code if a part from this code i can insert another code.

please tell

its urgent
thanks
 
Rob Spoor
Sheriff
Posts: 20822
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seema chhetri wrote:its urgent

Maneesh already told you to ease up. We are all volunteers here that visit in our spare time.
 
seema chhetri
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,

i got the way.
please let me know if there is any solution of my problem .




thanks
 
seema chhetri
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello

i have an jtree and
nodes are not predefine that is get fetch by the somewhere.if suppose the fetch data - Jtree - contain - modules- contain tables and application component . we only want a checkbox in tables . and application components contain tables .
icon is in whole tree
please tell me the solution or send me the code if there is any code.
please tell

its urgent
thanks
 
Rob Spoor
Sheriff
Posts: 20822
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seema chhetri wrote:its urgent
thanks

I bet it is, but you've already been asked to refrain from telling us that. Please stop it.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the best way for you to get a solution is to write a sample program that relies on no data outside
of the program i.e. the 'fetch data' has to come from within the program - arraylist/vector etc.

then post the program, pointing out what it does do, and what you'd like it to do.
the solution might be as simple as a single line of code.

[EDIT]
don't include anything in the sample program that is not related to the problem e.g. menu items
 
seema chhetri
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi




thanks
 
Mikko Kohtamäki
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First in createTreePanel() you are creating DefaultMutableTreeNode instead of CheckNode so NodeSelectionListener gives ClassCastException, in CheckRenderer I had to add check.setSelected(isSelected); and row height i setted to 18 to see all the contents of it.

I used one image (12x12) for all icons to see the result. Why remove any caps ? Only thing is that selection stumbles a little.

I got screen capture
sample.png
[Thumbnail for sample.png]
tree sample
 
seema chhetri
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

thanks for the answer, but i want a checkbox in a table only .
can you tell me and please send me the code also.

thanks
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> but i want a checkbox in a table only .

read the JTable tutorial - it has a checkbox column (vegetarian), which you can see in the screenshot in that page

http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
 
seema chhetri
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

i got the site but i didnot that , if ppossible please help me in merging a code in given code.
this code contain only image please help me for inserting a checkbox only in table.



thanks a lot
 
seema chhetri
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use one thread per question
http://faq.javaranch.com/java/UseOneThreadPerQuestion
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!