Unable to get height

the following code is in kotlin, but does anyone have an idea as to why i'm unable to get the height? thanks
No description
23 Replies
JavaBot
JavaBot10mo ago
This post has been reserved for your question.
Hey @taun! 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.
taun
taunOP10mo ago
setSize(600,600) in case that matters
dan1st
dan1st10mo ago
what's g and what's the error with the dot next to it?
taun
taunOP10mo ago
No description
dan1st
dan1st10mo ago
ok so g may be null because it's a Graphics? should the parameter be nullable?
taun
taunOP10mo ago
i don't think so
dan1st
dan1st10mo ago
then change the Graphics? to Graphics if possible
taun
taunOP10mo ago
yeah i removed it, the error from the dot disappeared still unable to .height though
taun
taunOP10mo ago
is it possible its using the second option?
No description
taun
taunOP10mo ago
if i do the scala option then i still get this as my only option
No description
dan1st
dan1st10mo ago
ok so is MainFrame an object?
taun
taunOP10mo ago
yes
dan1st
dan1st10mo ago
Can you show it?
taun
taunOP10mo ago
No description
dan1st
dan1st10mo ago
Can you use it outside of drawLine?
taun
taunOP10mo ago
not really
No description
taun
taunOP10mo ago
i can but not alot of options
dan1st
dan1st10mo ago
also not if you comment out the drawLine method? maybe you need to declare MainFrame before GraphicsPanel?
taun
taunOP10mo ago
don't think anything changed
No description
dan1st
dan1st10mo ago
what's the warning with MainFrame? Do you import any MainFrame from somewhere else maybe?
taun
taunOP10mo ago
you were correct, it was importing the scala one at the top thank you so much
JavaBot
JavaBot10mo 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
JavaBot10mo ago
Post Closed
This post has been closed by <@239353471285854208>.
Want results from more Discord servers?
Add your server