26208

Increase size of Text in Jtree

I'm trying to increase the size of the text of nodes in my Jtree. Is there any way to do this with/without altering other swing components?

Thanks!

Answer1:

Use JTree.setFont. For example:

final Font currentFont = tree.getFont(); final Font bigFont = new Font(currentFont.getName(), currentFont.getStyle(), currentFont.getSize() + 10); tree.setFont(bigFont);

Recommend

  • Incorrect position of Swing components
  • Hide/change collapse [-] and expand [ ] button on JTree
  • How to place components beneath tabs in right oriented JTabbedPane
  • UIView elements relevant to subclass of UIView are showing up outside of their container
  • “append” text for JTextField
  • How to add fonts using tFPDF
  • Creating a JLabel with a Gradient
  • How to show “properties window” of native file system's file/folder in java
  • TableViewCell to auto-resize its height according to content in xcode?
  • JavaFx: How to make 'Tooltip' bigger?
  • How to make the horizontal scroll bar appear in a JScrollPane that contains a JTextPane component
  • Text Field and KeyBinding
  • Icon's priority on action bar (keeping order of items)
  • Python : Find tuples from a list of tuples having duplicate data in the 0th element(of the tuple)
  • Custom UITableViewCell in UISearchDisplayController
  • JavaFX not finding all system fonts
  • How to make a modal JFrame or another JComponent?
  • Verify if a service is marked for deletion
  • JavaFX Marquee Animation
  • Wait for Swing to finish updating JProgressBar before continuing
  • Does Swing come with Calendar and time field components?
  • Threads in jMonkey and Nifty?
  • How to add learning rate to summaries?
  • How do I change the kernel/python version for iPython?
  • d3.js selection conditional rendering
  • Plotting densities in R
  • Consuming a WCF service in a Java Client using wsHttpBinding
  • How do I include a SWC in an AS2 Flash project?
  • Zurb Foundation _global.scss meta styles for js?
  • Swing - Get new component under mouseReleased
  • Magento Fatal error: Maximum execution error solution, on WAMP
  • Avoid links criss cross / overlap in d3.js using force layout
  • Change JButton Shape while respecting Look And Feel
  • Android screen density dpi vs ppi
  • Updating server-side rendering client-side
  • DirectX11 ClearRenderTargetViewback with transparent buffer?
  • Change an a tag attribute in JavaScript based on screen width
  • Web-crawler for facebook in python
  • trying to dynamically update Highchart column chart but series undefined
  • java string with new operator and a literal