html - Java: JScrollPane JLabel too close to edge -
I have a jlabel inside jscrollpane that format html to use it. The problem is on code github that the text inside both H1 tags is very close to the left, even when properly aligned. Any help would be greatly appreciated :)
package malgm.minecraft.versioninstaller.ui.tabs.credits; Import java.awt.borderLayout; Import javax.swing. *; Import malgm.minecraft.versioninstaller. *; Import malgm.minecraft.versioninstaller.ui.TechUI; Import malgm.minecraft.versioninstaller.ui.controls.TiledBackground; Public category credits extend Infantal Tilebeckell {Personal Static last long serial VERSIONUID = 1 L; Private ResourceFinder ResFinder = New ResourceFinder (); Private Data Data = New Data (); Public credits Infernal (Resource Loader Loader) {Super (Loader.GetImage (Resphx Background Background)); Border layout layout = new border layout (); SetLayout (layout); // welcome text jlabble text = new jlabel ("& lt; html>" + "level align \" right \ "& gt;" + "& lt; h1 & gt;" + data. GetMViname () + "Build" + Data "+" & lt; h3 & gt; Development Team: & lt; / h3 & gt; "+" & lt; p & gt; malgm () Jamie) & lt; / P & gt; "+" & Lt; H3 & gt; Special thanks: & lt; / H3 & gt; "+" & lt; P & gt; Without their technical team, I will not have this design. & Lt; / P & gt; "+" ++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++ + "+" & lt; H1 & gt; "+ Data. GetMMLName () +" build "+ data .getMMLBuild () +" & lt; / H1> "+" & lt; / Div & gt; "+" & lt; Center & gt; "+" & lt; H3 & gt; Development Team: & lt; / H3 & gt; "+" & lt; P & gt; Mallgam (Jamie) & lt; / P & gt; "+" & Lt; / center & gt; & Lt; / Html & gt; "); text.setForeground (TechUI.COLOR_WHITE_TEXT); JScrollPane s = new JScrollPane (text); s.setOpaque (wrong); S.getViewport () setOpaque; s.setBorder (zero); add (s, Border layout.CENTER);}}
Try it:
text. SetBorder (BorderFactory.createEmptyBorder (15, 15, 15, 15));
Comments
Post a Comment