cannot resolve symbol "OptionsValue".

so i started to learn Java Swing for about 2 days now and i wanted to make a custom font. StackOverFlow says to add this code into my java file (https://stackoverflow.com/a/7155079). yet, when I inserted it into my code, I get this error. Help is appreciated, most preferably, before i lose my sanity.
No description
9 Replies
JavaBot
JavaBot14mo ago
This post has been reserved for your question.
Hey @real! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st14mo ago
What's OptionsValues supposed to be? Also getResourceAsStream doesn't work with full paths What are you attempting to do?
JavaBot
JavaBot14mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
real
realOP14mo ago
basically creating a font variable which i can use in my project for the Buttons, TextFields etc and SOF says to use this piece of code.
InputStream is = OptionsValues.class.getResourceAsStream("fonts//KOMIKAX_.ttf");
TITLEFONT = Font.createFont(Font.TRUETYPE_FONT, is).deriveFont(Font.BOLD, 40f);
InputStream is = OptionsValues.class.getResourceAsStream("fonts//KOMIKAX_.ttf");
TITLEFONT = Font.createFont(Font.TRUETYPE_FONT, is).deriveFont(Font.BOLD, 40f);
now i didnt add this line of code
TITLEFONT = Font.createFont(Font.TRUETYPE_FONT, is).deriveFont(Font.BOLD, 40f);
TITLEFONT = Font.createFont(Font.TRUETYPE_FONT, is).deriveFont(Font.BOLD, 40f);
cus the first line doesnt work
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
dan1st
dan1st14mo ago
well you used an absolute path instead of fonts//KOMIKAX_.ttf
real
realOP14mo ago
true, i did but is there any problem with doing that? i really dont know yep,
Main
Main
is my class works like a charm 👍 thanks my drilla
JavaBot
JavaBot14mo ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
JavaBot
JavaBot14mo ago
Post Closed
This post has been closed by <@761530490406305833>.

Did you find this page helpful?