File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in alignment of its text in JButton with its image

 
ahmedali mohd
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,


In my application, I would like to use the format in my application like as follows

User1
:User2
User3

I want simple code for either using JButton or JLabel. I 've used JLabel due to its aligment properties which looks good but JLabel doesn't have action listeners to perform some operations. If i use JButton then I m not able to align the same i've mention above user left side image then afterwards user_name. Using button, there is gap between image and user_name which looks bad.

Is't there any other components which is very easy to implement except JTree.

It is very urgent. Please let me know quickly
 
Rob Camick
Ranch Hand
Posts: 2473
8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using button, there is gap between image and user_name which looks bad.


Personally, I think it looks good. White spaces exists for a reason. Take a look at the browser you are using. I bet all the menu items or toolbar buttons have a gap between the icon and the text. The UI designers of IE have more experience than you do.

But if you really want to proceed, then read the JButton API you will find a method that allows you to control the icon/text "gap".
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic