1

I am a beginner in Java GUI, and I want to set a good looking look and feel; but the problem is that I don't like any of the look and feel completely. Everyone has some good and some bad styles. Being specific, I am using Nimbus look and feel, but I like the table and text area of liquid look and feel. I want to use Nimbus look and feel as default, but only use JTable and JTextArea of Liquid Look and feel. Is this possible?

Please answer using easy vocabulary, as I said I am a beginner.

ps: I use Netbeans.

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
MMujtabaRoohani
  • 483
  • 4
  • 19
  • I am using netbeans as an IDE, This is just for your information. – MMujtabaRoohani Jul 24 '13 at 00:52
  • 2
    I can't really be done, not without a lot of work. A look and feel is expected to be a single, unified presentation layer. You could take a look at [Synth Look and Feel](http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/synth.html) which is about skinning and which Nimbus uses. Personally, I'd stick to the platform look and feel, you'll get much more user acceptance if you stick to what the user expects and is use to - IMHO – MadProgrammer Jul 24 '13 at 01:01
  • Thanks for your help, is it your opinion or you are sure about it? that It Can't be done – MMujtabaRoohani Jul 24 '13 at 19:33
  • @MadProgrammer's caveats are well founded; only you can determine if the _ad hoc_ approach I suggest below will meet your requirements for user acceptance. – trashgod Jul 24 '13 at 20:12
  • The Problem is that I don't want to set the icons but I need to change the whole look and feel of a Swing Component for example in seaGlass – MMujtabaRoohani Jul 24 '13 at 22:07
  • The JtextArea shows very good fonts as well as lines which I like and i want to override the Nimbus TextArea with the Sea Glass Look And Feel – MMujtabaRoohani Jul 25 '13 at 00:24

1 Answers1

2

You may be able to use the ad hoc approach shown here for JTree icons.

image

Left: com.apple.laf.AquaLookAndFeel

Right: javax.swing.plaf.metal.MetalLookAndFeel

Addendum: While not all combinations are compatible, you can examine the defined UIManager Defaults for keys common to both. A few JTable examples are shown here.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • sorry, but the problem is that I said in my question that I want to use only Jtable and JtextArea, I have already used the renderer for Jtree. But thanks for your answer. – MMujtabaRoohani Jul 24 '13 at 19:31
  • You can edit your question to include an [sscce](http://sscce.org/) based on the [example](http://stackoverflow.com/a/14262706/230513) cited and the relevant [`UIManager` defaults](http://stackoverflow.com/a/3974748/230513). – trashgod Jul 24 '13 at 20:07
  • what is the need of SSCCE when, Netbeans automatically sets the Nimbus Look & Feel code in main Method – MMujtabaRoohani Jul 25 '13 at 00:25
  • You'd need to do so if you have specific trouble with this approach. – trashgod Jul 25 '13 at 00:32
  • are you saying this that the ad hoc approach can even be used on any look and feel – MMujtabaRoohani Jul 27 '13 at 01:24
  • Yes, but @MadProgrammer is also correct that not all combinations are fruitful. You'll have to test empirically. – trashgod Jul 27 '13 at 02:52
  • I was trying to ask that will the ad hoc approach will be applicable on JtextArea and JTable or it can only be used in JTree – MMujtabaRoohani Jul 27 '13 at 20:13
  • What `UIManager` keys did you try? What happened when you tried them? – trashgod Jul 28 '13 at 00:21
  • I can't understand what you are trying to say, I am just using Netbeans as an IDE and in that I am using it's Drag and Drop Tool with Free Design Layout – MMujtabaRoohani Jul 28 '13 at 00:43
  • I just can't find your answer valid because I also knew completely how to render a JTree and I did it before but I cannot render Jtable and JtextArea – MMujtabaRoohani Jul 28 '13 at 00:44
  • These [answers](http://stackoverflow.com/search?q=user%3A230513+%5Bjtable%5D+uimanager) illustrate changing various `UIManager` properties used by `JTable`; experiment with changing them. – trashgod Jul 28 '13 at 01:18